docs: def GetIapKey(key_id):
    """Retrieves a public key from the list published by Identity-Aware Proxy.
  
    The key file is re-fetched if necessary.
  
    Args:
      key_id: Key id.
  
    Returns:
      String with a key.
  
    Raises:
      KeyNotFoundError: if the key is not found in the key file.
      KeysCanNotBeFetchedError: if the key file can't be fetched.
    """
    global _KEY_CACHE
    key = _KEY_CACHE.get(key_id)
    if not key:
      # Re-fetch the key file.
      resp = requests.get("https://www.gstatic.com/iap/verify/public_key")
      if resp.status_code != 200:
        raise KeysCanNotBeFetchedError(
            "Unable to fetch IAP keys: {} / {} / {}".format(
                resp.status_code, resp.headers, resp.text))
      _KEY_CACHE = resp.json()
      key = _KEY_CACHE.get(key_id)
      if not key:
        raise KeyNotFoundError("Key {!r} not found".format(key_id))
    return key