def _ParseAndValidateModuleYamls(self, yaml_paths):
    """Validates given yaml paths and returns the parsed yaml objects.

    Args:
      yaml_paths: List of paths to AppInfo yaml files.

    Returns:
      List of parsed AppInfo yamls.
    """
    results = []
    app_id = None
    last_yaml_path = None
    for yaml_path in yaml_paths:
      if not os.path.isfile(yaml_path):
        _PrintErrorAndExit(
            self.error_fh,
            ("Error: The given path '%s' is not to a YAML configuration "
             "file.\n") % yaml_path)
      file_name = os.path.basename(yaml_path)
      base_path = os.path.dirname(yaml_path)
      if not base_path:
        base_path = '.'
      module_yaml = self._ParseAppInfoFromYaml(base_path,
                                               os.path.splitext(file_name)[0])

      if not module_yaml.module and file_name != 'app.yaml':
        _PrintErrorAndExit(
            self.error_fh,
            "Error: 'module' parameter not specified in %s" % yaml_path)



      if app_id is not None and module_yaml.application != app_id:
        _PrintErrorAndExit(
            self.error_fh,
            "Error: 'application' value '%s' in %s does not match the value "
            "'%s', found in %s" % (module_yaml.application,
                                   yaml_path,
                                   app_id,
                                   last_yaml_path))
      app_id = module_yaml.application
      last_yaml_path = yaml_path
      results.append(module_yaml)

    return results
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/appcfg.py/AppCfgApp._ParseAndValidateModuleYamls/original