code: def active_user_key(self) -> Optional[IAMKey]:
      if len(self.kube_secrets) > 0:
          try:
              kube_key = next(
                  k
                  for k in self.keys
                  if all(
                      s.matches_iam_key(k) for s in self.kube_secrets
                  )
              )
          except StopIteration:
              keys_to_k8s_secret = defaultdict(list)
              for s in self.kube_secrets:
                  keys_to_k8s_secret[s.private_key_id()].append(
                      (s.name, s.namespace)
                  )
              keys_to_k8s_secret_str = "\n".join(
                  f"{k} " + ", ".join(str(s) for s in secrets)
                  for k, secrets in keys_to_k8s_secret.items()
              )
              known_iam_keys_str = "\n".join(
                  f"{k.id} Created: {k.created_readable} Expires: {k.expiration_readable}"
                  for k in self.keys
              )
              kube_key = sorted(
                  [k for k in self.keys if k.id in keys_to_k8s_secret],
                  key=lambda k: -k.created.timestamp(),
              )[0]
              print(
                  f"""Found a user ({self.username()}) without a unique active key in Kubernetes.
  The known IAM keys are:
  {known_iam_keys_str}
  
  These keys are present in Kubernetes:
  {keys_to_k8s_secret_str}
  
  We will assume {kube_key.id} is the active key.
  """
              )
          assert kube_key is not None
          assert kube_key.user_managed
          return kube_key
      # We assume that if the key is not used in kubernetes, the most recently
      # created user-managed key should be considered "active".
      return next((k for k in self.keys if k.user_managed), None)
  
imports: import asyncio
  import base64
  import itertools
  import json
  import sys
  import warnings
  from datetime import datetime, timedelta
  from enum import Enum
  from typing import Generator, List, Optional, TextIO, Tuple, Any, TypedDict, Set, Dict
  import kubernetes_asyncio.client
  import kubernetes_asyncio.config
  import pytz
  from dateutil.parser import isoparse
  from hailtop.aiocloud.aiogoogle import GoogleIAmClient
  from hailtop.utils import retry_transient_errors
label_desc: Use image node_id 6 for calling the ServiceAccount obj's underlying member method code with example usage: obj.active_user_key() and returns: next, kube_key