decode_header accepts a parameter of type str or Header, but the stub for decode_header types the parameter as Header. Change that to Union[Header, str].