code: def actor_from_request(datasette, request):
      if "ds_actor" not in request.cookies:
          return None
      try:
          decoded = datasette.unsign(
              request.cookies["ds_actor"], "actor"
          )
          # If it has "e" and "a" keys process the "e" expiry
          if not isinstance(decoded, dict) or "a" not in decoded:
              return None
          expires_at = decoded.get("e")
          if expires_at:
              timestamp = int(baseconv.base62.decode(expires_at))
              if time.time() > timestamp:
                  return None
          return decoded["a"]
      except BadSignature:
          return None
  
imports: from datasette import hookimpl
  from itsdangerous import BadSignature
  from datasette.utils import baseconv
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: actor_from_request(datasette, request) and returns: None, decoded, None, None, None