def parse_authorization_code_response(uri, state=None):
    if not is_secure_transport(uri):
        raise InsecureTransportError()

    query = urlparse.urlparse(uri).query
    params = dict(urlparse.parse_qsl(query))

    if not 'code' in params:
        raise MissingCodeError("Missing code parameter in response.")

    if state and params.get('state', None) != state:
        raise MismatchingStateError()

    return params
Parse authorization grant response URI into a dict.
dataset/ETHPy150Open idan/oauthlib/oauthlib/oauth2/rfc6749/parameters.py/parse_authorization_code_response