def valid(self, time: int = None) -> bool:
if time is None:<EOL><INDENT>epoch = datetime(<NUM_LIT>, <NUM_LIT:1>, <NUM_LIT:1>, <NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>)<EOL>now = datetime.utcnow()<EOL>time = int((now - epoch).total_seconds())<EOL><DEDENT>if isinstance(self.valid_from, int) and time < self.valid_from:<EOL><INDENT>return False<EOL><DEDENT>if isinstance(self.valid_to, int) and time > self.valid_to:<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
Is the token valid? This method only checks the timestamps within the
token and compares them against the current time if none is provided.

:param time: The timestamp to validate against
:type time: Union[int, None]
:return: The validity of the token.
:rtype: bool