def METHOD_NAME(*, code=None, refresh_token=None, config=None):
    """Given an FxA access code or refresh token, return dict from FxA /token endpoint
    (https://git.io/JJZww). Should at least contain `access_token` and
    `id_token` keys.
    """
    assert config, 'config dict must be provided to get_fxa_token'
    assert (
        code or refresh_token
    ), 'either code or refresh_token must be provided to get_fxa_token'
    log_identifier = f'code:{code}' if code else f'refresh:{refresh_token[:8]}'
    log.info(f'Getting token [{log_identifier}]')
    with statsd.timer('accounts.fxa.identify.token'):
        if code:
            grant_data = {'grant_type': 'authorization_code', 'code': code}
        else:
            grant_data = {'grant_type': 'refresh_token', 'refresh_token': refresh_token}
        response = requests.post(
            settings.FXA_OAUTH_HOST + '/token',
            data={
                **grant_data,
                'client_id': config['client_id'],
                'client_secret': config['client_secret'],
            },
        )
    if response.status_code == 200:
        data = response.json()
        if data.get('access_token'):
            log.info(f'Got token for [{log_identifier}]')
            data['access_token_expiry'] = time.time() + data.get('expires_in', 43200)
            return data
        else:
            log.info(f'No token returned for [{log_identifier}]')
            raise IdentificationError(f'No access token returned for {log_identifier}')
    else:
        log.info(
            'Token returned non-200 status {status} {body} [{code_or_token}]'.format(
                code_or_token=log_identifier,
                status=response.status_code,
                body=response.content,
            )
        )
        raise IdentificationError(f'Could not get access token for {log_identifier}')