y:
            version = int(header_version)
        except ValueError:
            version = None

        kid = parsed_header.get(&#34;kid&#34;)
        # isinstance(version, int) returns False for None (if it fails to parse the version)
        if (
            parsed_header[&#34;typ&#34;] != &#34;JWT&#34;
            or not isinstance(version, int)
            or version &lt; 3
            or kid is None
        ):
            raise Exception(&#34;JWT header mismatch&#34;)

    return ParsedJWTInfo(
   