def refresh_access_token(self, target_id, token, grant_type, **kwargs):
        """

        :param target_id: Who gave me this token
        :param token: The refresh_token
        :param grant_type: Which grant type the token is connected to
        :param kwargs: Extra key word arguments
        :return: New access_token
        """
        # Check that the token is an refresh token
        info = self.refresh_token_factory.get_info(token)

        # Make sure the token should is usable by the client to get a
        # refresh token
        try:
            if target_id != info["azr"]:
                raise NotAllowed("{} can't use this token".format(target_id))
        except KeyError:
            if target_id not in info['aud']:
                raise NotAllowed("{} can't use this token".format(target_id))

        if self.token_factory.is_valid(info):
            try:
                lifetime = self.token_policy['access_token'][target_id][
                    grant_type]
            except __HOLE__:
                raise NotAllowed(
                    'Issue access token for grant_type {} for target_id {} not allowed')
            else:
                sid = self.token_factory.db[info['jti']]
                try:
                    _aud = kwargs['aud']
                except KeyError:
                    _aud = info['aud']

                return self.token_factory(
                    sid, target_id=target_id, lifetime=lifetime, aud=_aud)
dataset/ETHPy150Open rohe/pyoidc/src/oic/utils/token_handler.py/TokenHandler.refresh_access_token