def EnumerateAllConfigs(self, stats, file_objects):
    """Generate RDFs for the fully expanded configs.

    Args:
      stats: A list of RDF StatEntries corresponding to the file_objects.
      file_objects: A list of file handles.

    Returns:
      A tuple of a list of RDFValue PamConfigEntries found & a list of strings
      which are the external config references found.
    """
    # Convert the stats & file_objects into a cache of a
    # simple path keyed dict of file contents.
    cache = {}
    for stat_obj, file_obj in zip(stats, file_objects):
      cache[stat_obj.pathspec.path] = file_obj.read()

    result = []
    external = []
    # Check to see if we have the old pam config file laying around.
    if self.OLD_PAMCONF_FILENAME in cache:
      # The PAM documentation says if it contains config data, then
      # it takes precedence over the rest of the config.
      # If it doesn't, the rest of the PAMDIR config counts.
      result, external = self.EnumerateConfig(None, self.OLD_PAMCONF_FILENAME,
                                              cache)
      if result:
        return result, external

    # If we made it here, there isn't a old-style pam.conf file worth
    # speaking of, so process everything!
    for path in cache:
      # PAM uses the basename as the 'service' id.
      service = os.path.basename(path)
      r, e = self.EnumerateConfig(service, path, cache)
      result.extend(r)
      external.extend(e)
    return result, external
dataset/ETHPy150Open google/grr/grr/parsers/linux_pam_parser.py/PAMParser.EnumerateAllConfigs/original