code: def is_token_valid(self, access_token: AccessToken) -> bool:
      data = self._token_to_bytes(access_token)
      if not self._authority_public_key.verify(
          data, access_token.signature
      ):
          logger.exception("Access token has invalid signature")
          return False
  
      try:
          expiration_time = datetime.fromisoformat(
              access_token.expiration_time
          )
      except ValueError:
          logger.exception(
              f"datetime.fromisoformat() failed to parse expiration time: {access_token.expiration_time}"
          )
          return False
      if expiration_time.tzinfo is not None:
          logger.exception(
              f"Expected to have no timezone for expiration time: {access_token.expiration_time}"
          )
          return False
      if expiration_time < datetime.utcnow():
          logger.exception("Access token has expired")
          return False
  
      return True
  
file_path: hivemind/tests/test_auth.py
imports: from datetime import datetime, timedelta
  from typing import Optional
  import pytest
  from hivemind.proto import dht_pb2
  from hivemind.proto.auth_pb2 import AccessToken
  from hivemind.utils.auth import AuthRole, AuthRPCWrapper, TokenAuthorizerBase
  from hivemind.utils.crypto import RSAPrivateKey
  from hivemind.utils.logging import get_logger
label_desc: Use image node_id 2 for calling the MockAuthorizer obj's underlying member method code with example usage: obj.is_token_valid(access_token) and returns: True, False, False, False, False