def compare(self, jwt: '<STR_LIT>', compare_dates: bool = False) -> bool:
if self.secret != jwt.secret:<EOL><INDENT>return False<EOL><DEDENT>if self.payload != jwt.payload:<EOL><INDENT>return False<EOL><DEDENT>if self.alg != jwt.alg:<EOL><INDENT>return False<EOL><DEDENT>if self.header != jwt.header:<EOL><INDENT>return False<EOL><DEDENT>expected_claims = self.registered_claims<EOL>actual_claims = jwt.registered_claims<EOL>if not compare_dates:<EOL><INDENT>strip = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>expected_claims = {k: {v if k not in strip else None} for k, v in<EOL>expected_claims.items()}<EOL>actual_claims = {k: {v if k not in strip else None} for k, v in<EOL>actual_claims.items()}<EOL><DEDENT>if expected_claims != actual_claims:<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
Compare against another `Jwt`.

:param jwt: The token to compare against.
:type jwt: Jwt
:param compare_dates: Should the comparision take dates into account?
:type compare_dates: bool
:return: Are the two Jwt's the same?
:rtype: bool