def {{ auth.type }}_{{ auth.python_name }}(
    username: str,
    password: str,
    scope: Union[Iterable[Literal{{ auth.scopes.keys() | list }}], None] = None,
    **kwargs,
) -> NamedAuth:
    if scope is not None:
        kwargs['scope'] = ' '.join(scope)

    return '{{ auth.name }}', httpx_auth.OAuth2ResourceOwnerPasswordCredentials(
        token_url='{{ auth.token_url }}',
        username=username,
        password=password,
        **kwargs,
    )
