# ruff: noqa
import builtins
from typing import (
    Any,
    Callable,
    Iterable,
    Iterator,
    Sequence,
    overload,
)

def all(iterable: Iterable[builtins.bool]) -> builtins.bool:
    """Return True if all elements of the iterable are true.

    Args:
        iterable: The iterable to evaluate.

    Returns:
        True if all elements are true, False otherwise.
    """
    ...

def any(iterable: Iterable[builtins.bool]) -> builtins.bool:
    """Return True if any element of the iterable is true.

    Args:
        iterable: The iterable to evaluate.

    Returns:
        True if any element is true, False otherwise.
    """
    ...

def sum(
    iterable: Iterable[builtins.int | builtins.float], /, start: builtins.int | builtins.float = 0
) -> builtins.int | builtins.float:
    """Return the sum of a 'start' value (default: 0) and an iterable of numbers.

    Args:
        iterable: The iterable of numbers to sum.
        start: The starting value to add to the sum.

    Returns:
        The total sum.
    """
    ...

def abs(x: builtins.int | builtins.float) -> builtins.int | builtins.float:
    """Return the absolute value of a number.

    Args:
        x: A number.

    Returns:
        The absolute value of x.
    """
    ...

def bool(x: builtins.int | builtins.float | builtins.bool) -> builtins.bool:
    """Convert a value to a Boolean.

    Args:
        x: The value to convert.

    Returns:
        The Boolean value of x.
    """
    ...

def callable(obj: object) -> bool:
    """Check if the object appears callable.

    Args:
        obj: The object to check.

    Returns:
        True if the object appears callable, False otherwise.
    """
    ...

@overload
def dict() -> builtins.dict: ...
@overload
def dict[K, V](mapping: builtins.dict[K, V], **kwargs: V) -> builtins.dict[K, V]: ...
@overload
def dict[K, V](iterable: Iterable[tuple[K, V]], **kwargs: V) -> builtins.dict[K, V]: ...
@overload
def dict[V](**kwargs: V) -> builtins.dict[builtins.str, V]: ...
def dict(*args, **kwargs) -> builtins.dict:
    """Construct a dict from a mapping, an iterable of key-value pairs, or keyword arguments.

    All dict keys must be compile-time constants. Dynamic access using a key that is not
    a compile-time constant is only supported for numeric, Array, and Record values.

    Args:
        mapping_or_iterable: An optional dict to copy from, or an iterable of
            ``(key, value)`` pairs.
        **kwargs: Optional keyword arguments to include in the dict.

    Returns:
        A new dict.
    """
    ...

def enumerate[T](iterable: Iterable[T], start: int = 0) -> Iterator[tuple[int, T]]:
    """Return an enumerate object.

    Args:
        iterable: The iterable to enumerate.
        start: The starting index.

    Returns:
        An enumerate object.
    """
    ...

def filter[T](function: Callable[[T], builtins.bool] | None, iterable: Iterable[T]) -> Iterator[T]:
    """Construct an iterator from those elements of iterable for which function returns true.

    Args:
        function: A function that tests if each element should be included. If None, returns the elements that are true.
        iterable: The iterable to filter.

    Returns:
        An iterator yielding the filtered elements.
    """
    ...

def float(x: builtins.int | builtins.float) -> builtins.float:
    """Convert a number to a floating point number.

    Args:
        x: The number to convert.

    Returns:
        The floating point representation of x.
    """
    ...

@overload
def getattr(obj: object, name: builtins.str) -> Any: ...
@overload
def getattr[T](obj: object, name: builtins.str, default: T) -> Any | T: ...
def getattr(obj: object, name: builtins.str, default: Any = ...) -> Any:
    """Get a named attribute from an object.

    Args:
        obj: The object to get the attribute from.
        name: The name of the attribute.
        default: The value to return if the attribute does not exist.

    Returns:
        The value of the attribute, or default if it does not exist.
    """
    ...

def hasattr(obj: object, name: builtins.str) -> builtins.bool:
    """Check if an object has a named attribute.

    Can result in a compile-time error if an unsupported property is checked,
    since later trying to access it would also fail.

    Args:
        obj: The object to check.
        name: The name of the attribute.

    Returns:
        True if the object has the attribute, False otherwise.
    """
    ...

def int(x: builtins.int | builtins.float) -> builtins.int:
    """Convert a number to an integer.

    Args:
        x: The number to convert.

    Returns:
        The integer representation of x.
    """
    ...

def isinstance(obj: object, classinfo: type | tuple[type, ...]) -> builtins.bool:
    """Check if an object is an instance of a class or of a subclass thereof.

    Args:
        obj: The object to check.
        classinfo: A type or a tuple of types.

    Returns:
        True if the object is an instance of classinfo, False otherwise.
    """
    ...

def issubclass(cls: type, classinfo: type | tuple[type, ...]) -> builtins.bool:
    """Check if a class is a subclass of another class or a tuple of classes.

    Args:
        cls: The class to check.
        classinfo: A class or a tuple of classes.

    Returns:
        True if cls is a subclass of classinfo, False otherwise.
    """
    ...

def iter[T](iterable: Iterable[T]) -> Iterator[T]:
    """Return an iterator for the given iterable.

    Args:
        iterable: The iterable to convert to an iterator.

    Returns:
        An iterator over the elements of the iterable.
    """
    ...

def len(s: object) -> builtins.int:
    """Return the number of items in a container.

    Args:
        s: The container object.

    Returns:
        The number of items in s.
    """
    ...

def map[T, S](function: Callable[[T], S], iterable: Iterable[T]) -> Iterator[S]:
    """Apply a function to every item of an iterable and return an iterator.

    Args:
        function: The function to apply.
        iterable: The iterable to process.

    Returns:
        An iterator with the results.
    """
    ...

@overload
def max[T](iterable: Iterable[T], *, key: Callable[[T], Any] | None = ...) -> T: ...
@overload
def max(
    iterable: Iterable[builtins.int | builtins.float],
    *,
    default: builtins.int | builtins.float = ...,
    key: Callable[[builtins.int | builtins.float], Any] | None = ...,
) -> builtins.int | builtins.float: ...
@overload
def max[T](arg1: T, arg2: T, *args: T, key: Callable[[T], Any] | None = ...) -> T: ...
def max(*args, **kwargs):
    """Return the largest item in an iterable or the largest of multiple arguments.

    When called with a single iterable, returns the largest item from that iterable.
    When called with multiple arguments, returns the largest argument.

    Use the `key` parameter to specify a function that transforms each element
    before comparison. Use the `default` parameter to specify a value to return
    if the iterable is empty (supported only for numeric values).
    """
    ...

@overload
def min[T](iterable: Iterable[T], *, key: Callable[[T], Any] | None = ...) -> T: ...
@overload
def min(
    iterable: Iterable[builtins.int | builtins.float],
    *,
    default: builtins.int | builtins.float = ...,
    key: Callable[[builtins.int | builtins.float], Any] | None = ...,
) -> builtins.int | builtins.float: ...
@overload
def min[T](arg1: T, arg2: T, *args: T, key: Callable[[T], Any] | None = ...) -> T: ...
def min(*args, **kwargs):
    """Return the smallest item in an iterable or the smallest of multiple arguments.

    When called with a single iterable, returns the smallest item from that iterable.
    When called with multiple arguments, returns the smallest argument.

    Use the `key` parameter to specify a function that transforms each element
    before comparison. Use the `default` parameter to specify a value to return
    if the iterable is empty (supported only for numeric values).
    """
    ...

def next[T](iterator: Iterator[T]) -> T:
    """Retrieve the next item from an iterator.

    Errors if the iterator is exhausted.

    Args:
        iterator: The iterator to retrieve the next item from.

    Returns:
        The next item from the iterator.
    """
    ...

@overload
def range(stop: builtins.int) -> builtins.range: ...
@overload
def range(start: builtins.int, stop: builtins.int, step: builtins.int = ...) -> builtins.range: ...
def range(*args) -> builtins.range:
    """Return an immutable sequence of numbers.

    When called with one argument, creates a sequence from 0 to that number (exclusive).
    When called with two arguments, creates a sequence from the first to the second (exclusive).
    When called with three arguments, the third argument specifies the step size.
    """
    ...

def reversed[T](seq: Sequence[T]) -> Iterator[T]:
    """Return a reverse iterator.

    Args:
        seq: The sequence to reverse.

    Returns:
        An iterator over the reversed sequence.
    """
    ...

def round(number: builtins.int | builtins.float, ndigits: builtins.int = ...) -> builtins.float:
    """Round a number to a given precision in decimal digits.

    Args:
        number: The number to round.
        ndigits: The number of decimal digits to round to.

    Returns:
        The rounded number.
    """
    ...

@overload
def set() -> builtins.set: ...
@overload
def set[T](iterable: Iterable[T]) -> builtins.set[T]: ...
def set(*args) -> builtins.set:
    """Construct a set from an iterable.

    All set members must be compile-time constants.

    Args:
        iterable: An optional iterable of compile-time constant values.

    Returns:
        A new set.
    """
    ...

def setattr(obj: object, name: builtins.str, value: Any) -> None:
    """Set a named attribute on an object.

    Args:
        obj: The object to set the attribute on.
        name: The name of the attribute.
        value: The value to set.

    Returns:
        None.
    """
    ...

def super(cls: type = ..., instance: Any = ...) -> Any:
    """Return a proxy object that delegates method calls to a parent or sibling class.

    Args:
        cls: The class to delegate.
        instance: The instance to delegate to.
    Returns:
        A proxy object that can be used to call methods from the parent or sibling class.
    """
    ...

def type(obj: object) -> builtins.type:
    """Return the type of an object.

    Args:
        obj: The object to get the type of.

    Returns:
        The type of the object.
    """
    ...

def zip[T](*iterables: Iterable[T]) -> Iterator[tuple[T, ...]]:
    """Return an iterator of tuples, where the i-th tuple contains the i-th element from each of the argument sequences.

    Args:
        *iterables: Iterables to aggregate.

    Returns:
        An iterator of aggregated tuples.
    """
    ...
