code: def check_yaml_configs(configs, key):
      
      diagnostic = {}
      for i in configs:
          for fname in i:
              with open(fname) as stream:
                  try:
                      res = yaml.load(stream, Loader=UnsafeLoader)
                      msg = 'ok'
                  except yaml.YAMLError as err:
                      stream.seek(0)
                      res = yaml.load(stream, Loader=BaseLoader)
                      if err.context == 'while constructing a Python object':
                          msg = err.problem
                      else:
                          msg = 'error'
                  finally:
                      try:
                          diagnostic[res[key]['name']] = msg
                      except (KeyError, TypeError):
                          # this object doesn't have a 'name'
                          pass
      return diagnostic
docs: Get a diagnostic for the yaml *configs*.
  
      *key* is the section to look for to get a name for the config at hand.