code: def _get_cached_certs(cert_uri, cache):
    
    certs = cache.get(cert_uri, namespace=_CERT_NAMESPACE)
    if certs is None:
      _logger.debug('Cert cache miss for %s', cert_uri)
      try:
        result = urlfetch.fetch(cert_uri)
      except AssertionError:
        # This happens in unit tests.  Act as if we couldn't get any certs.
        return None
  
      if result.status_code == 200:
        certs = json.loads(result.content)
        expiration_time_seconds = _get_cert_expiration_time(result.headers)
        if expiration_time_seconds:
          cache.set(cert_uri, certs, time=expiration_time_seconds,
                    namespace=_CERT_NAMESPACE)
      else:
        _logger.error(
            'Certs not available, HTTP request returned %d', result.status_code)
  
    return certs
docs: Get certs from cache if present; otherwise, gets from URI and caches them.
  
    Args:
      cert_uri: URI from which to retrieve certs if cache is stale or empty.
      cache: Cache of pre-fetched certs.
  
    Returns:
      The retrieved certs.