

def prepare_token_request(grant_type, body='', **kwargs):
    'Prepare the access token request.\n\n    The client makes a request to the token endpoint by adding the\n    following parameters using the ``application/x-www-form-urlencoded``\n    format in the HTTP request entity-body:\n\n    :param grant_type: To indicate grant type being used, i.e. "password",\n            "authorization_code" or "client_credentials".\n    :param body: Existing request body to embed parameters in.\n    :param code: If using authorization code grant, pass the previously\n                 obtained authorization code as the ``code`` argument.\n    :param redirect_uri: If the "redirect_uri" parameter was included in the\n                         authorization request as described in\n                         `Section 4.1.1`_, and their values MUST be identical.\n    :param kwargs: Extra arguments to embed in the request body.\n\n    An example of an authorization code token request body:\n\n    .. code-block:: http\n\n        grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA\n        &redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb\n\n    .. _`Section 4.1.1`: http://tools.ietf.org/html/rfc6749#section-4.1.1\n    '
    params = [('grant_type', grant_type)]
    if ('scope' in kwargs):
        params['scope'] = list_to_scope(kwargs['scope'])
    for k in kwargs:
        if kwargs[k]:
            params.append((unicode_type(k), kwargs[k]))
    return add_params_to_qs(body, params)

dataset/ETHPy150Open idan/oauthlib/oauthlib/oauth2/rfc6749/parameters.py prepare_token_request/VarMisuse@38/474 `kwargs`->`params`