def METHOD_NAME(self, alg, **kwargs):
    http_json = {}
    hash_size = get_hash_size(alg)
    for arg, (key, func) in SIMPLE_OPER.items():
        try:
            if func is None:
                http_json[key] = kwargs[arg]
            else:
                http_json[key] = func(kwargs[arg])
        except KeyError:
            pass
    for arg, (key, format) in PARAM_ARGS.items():
        try:
            http_json[key] = _serialize_params(kwargs[arg], format, hash_size)
        except KeyError:
            pass
    try:
        http_json["b"] = b64_hash(kwargs["body"], hash_size)
    except KeyError:
        pass
    if not http_json:
        raise ValueError("No data to sign")
    jws = JWS(json.dumps(http_json), alg=alg, typ="pop")
    _jwt = jws.sign_compact(keys=[self.key])
    return _jwt