def verify_header(reqresp, body_type):
    logger.debug("resp.headers: %s" % (reqresp.headers,))
    logger.debug("resp.txt: %s" % (reqresp.text,))

    if body_type == "":
        _ctype = reqresp.headers["content-type"]
        if match_to_("application/json", _ctype):
            body_type='json'
        elif match_to_("application/jwt", _ctype):
            body_type = "jwt"
        elif match_to_(URL_ENCODED, _ctype):
            body_type = 'urlencoded'
        else:
            body_type = 'txt'  # reasonable default ??
    elif body_type == "json":
        try:
            assert match_to_("application/json",
                             reqresp.headers["content-type"])
        except AssertionError:
            try:
                assert match_to_("application/jwt",
                                 reqresp.headers["content-type"])
                body_type = "jwt"
            except AssertionError:
                raise AssertionError("content-type: %s" % (
                    reqresp.headers["content-type"],))
    elif body_type == "jwt":
        try:
            assert match_to_("application/jwt",
                             reqresp.headers["content-type"])
        except AssertionError:
            raise AssertionError(
                "Wrong content-type in header, got: {} expected 'application/jwt'".format(
                    reqresp.headers["content-type"]))
    elif body_type == "urlencoded":
        try:
            assert match_to_(DEFAULT_POST_CONTENT_TYPE,
                             reqresp.headers["content-type"])
        except AssertionError:
            assert match_to_("text/plain",
                             reqresp.headers["content-type"])
    else:
        raise ValueError(body_type % "Unknown return format: %s")

    return body_type
dataset/ETHPy150Open rohe/pyoidc/src/oic/oauth2/util.py/verify_header/swapped operands of `%`