code: def _WriteCacheFile(self, cache_filename, scopes):
          
          # Credentials metadata dict.
          creds = {'scopes': sorted(list(scopes)),
                   'svc_acct_name': self.__service_account_name}
          creds_str = json.dumps(creds)
          cache_file = _MultiProcessCacheFile(cache_filename)
          try:
              cache_file.LockedWrite(creds_str)
          except KeyboardInterrupt:
              raise
          except:  # pylint: disable=bare-except
              # Treat exceptions as a cache miss.
              pass
docs: Writes the credential metadata to the cache file.
  
          This does not save the credentials themselves (CredentialStore class
          optionally handles that after this class is initialized).
  
          Args:
            cache_filename: Cache filename to check.
            scopes: Scopes for the desired credentials.