def get(iterable: Iterable[T], **attrs: Any) -> Optional[T]:
    "A helper that returns the first element in the iterable that meets\n    all the traits passed in ``attrs``. This is an alternative for\n    :func:`~discord.utils.find`.\n\n    When multiple attributes are specified, they are checked using\n    logical AND, not logical OR. Meaning they have to meet every\n    attribute passed in and not one of them.\n\n    To have a nested attribute search (i.e. search by ``x.y``) then\n    pass in ``x__y`` as the keyword argument.\n\n    If nothing is found that matches the attributes passed, then\n    ``None`` is returned.\n\n    Examples\n    ---------\n\n    Basic usage:\n\n    .. code-block:: python3\n\n        member = discord.utils.get(message.guild.members, name='Foo')\n\n    Multiple attribute matching:\n\n    .. code-block:: python3\n\n        channel = discord.utils.get(guild.voice_channels, name='Foo', bitrate=64000)\n\n    Nested attribute matching:\n\n    .. code-block:: python3\n\n        channel = discord.utils.get(client.get_all_channels(), guild__name='Cool', name='general')\n\n    Parameters\n    -----------\n    iterable\n        An iterable to search through.\n    \\*\\*attrs\n        Keyword arguments that denote attributes to search with.\n    "
    _all = all
    attrget = attrgetter
    if (len(attrs) == 1):
        (k, v) = attrs.popitem()
        pred = attrget(k.replace('__', '.'))
        for elem in iterable:
            if (pred(elem) == v):
                return elem
        return None
    converted = [(attrget(attr.replace('__', '.')), value) for (attr, value) in attrs.items()]
    for elem in iterable:
        if _all(((pred(elem) == value) for (pred, value) in converted)):
            return elem
    return None
A helper that returns the first element in the iterable that meets
all the traits passed in ``attrs``. This is an alternative for
:func:`~discord.utils.find`.

When multiple attributes are specified, they are checked using
logical AND, not logical OR. Meaning they have to meet every
attribute passed in and not one of them.

To have a nested attribute search (i.e. search by ``x.y``) then
pass in ``x__y`` as the keyword argument.

If nothing is found that matches the attributes passed, then
``None`` is returned.

Examples
---------

Basic usage:

.. code-block:: python3

    member = discord.utils.get(message.guild.members, name='Foo')

Multiple attribute matching:

.. code-block:: python3

    channel = discord.utils.get(guild.voice_channels, name='Foo', bitrate=64000)

Nested attribute matching:

.. code-block:: python3

    channel = discord.utils.get(client.get_all_channels(), guild__name='Cool', name='general')

Parameters
-----------
iterable
    An iterable to search through.
\*\*attrs
    Keyword arguments that denote attributes to search with.
def get(iterable: Iterable[T], **attrs: Any) -> Optional[T]:
    "A helper that returns the first element in the iterable that meets\n    all the traits passed in ``attrs``. This is an alternative for\n    :func:`~discord.utils.find`.\n\n    When multiple attributes are specified, they are checked using\n    logical AND, not logical OR. Meaning they have to meet every\n    attribute passed in and not one of them.\n\n    To have a nested attribute search (i.e. search by ``x.y``) then\n    pass in ``x__y`` as the keyword argument.\n\n    If nothing is found that matches the attributes passed, then\n    ``None`` is returned.\n\n    Examples\n    ---------\n\n    Basic usage:\n\n    .. code-block:: python3\n\n        member = discord.utils.get(message.guild.members, name='Foo')\n\n    Multiple attribute matching:\n\n    .. code-block:: python3\n\n        channel = discord.utils.get(guild.voice_channels, name='Foo', bitrate=64000)\n\n    Nested attribute matching:\n\n    .. code-block:: python3\n\n        channel = discord.utils.get(client.get_all_channels(), guild__name='Cool', name='general')\n\n    Parameters\n    -----------\n    iterable\n        An iterable to search through.\n    \\*\\*attrs\n        Keyword arguments that denote attributes to search with.\n    "
    _all = all
    attrget = attrgetter
    if (len(attrs) == 1):
        (k, v) = attrs.popitem()
        pred = attrget(k.replace('__', '.'))
        for elem in iterable:
            if (pred(elem) == v):
                return elem
        return None
    converted = [(attrget(attr.replace('__', '.')), value) for (attr, value) in attrs.items()]
    for elem in iterable:
        if _all(((pred(elem) == value) for (pred, value) in converted)):
            return elem
    return None