def fields_dict(cls):
    """
    Return an ordered dictionary of *attrs* attributes for a class, whose
    keys are the attribute names.

    :param type cls: Class to introspect.

    :raise TypeError: If *cls* is not a class.
    :raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
        class.

    :rtype: dict

    .. versionadded:: 18.1.0
    """
    if not isinstance(cls, type):
        raise TypeError("Passed object must be a class.")
    attrs = getattr(cls, "__attrs_attrs__", None)
    if attrs is None:
        raise NotAnAttrsClassError(f"{cls!r} is not an attrs-decorated class.")
    return {a.name: a for a in attrs}

    Return an ordered dictionary of *attrs* attributes for a class, whose
    keys are the attribute names.

    :param type cls: Class to introspect.

    :raise TypeError: If *cls* is not a class.
    :raise attrs.exceptions.NotAnAttrsClassError: If *cls* is not an *attrs*
        class.

    :rtype: dict

    .. versionadded:: 18.1.0
    
product/gradle-plugin/src/main/python/attr/_make.py