class_docstr: Import datasources in YAML format.
  
  This is the original unversioned format used to export and import datasources
  in Superset.
code: def validate(self) -> None:
      # ensure all files are YAML
      for file_name, content in self.contents.items():
          try:
              config = yaml.safe_load(content)
          except yaml.parser.ParserError as ex:
              logger.exception("Invalid YAML file")
              raise IncorrectVersionError(
                  f"{file_name} is not a valid YAML file"
              ) from ex
  
          # CLI export
          if isinstance(config, dict):
              # TODO (betodealmeida): validate with Marshmallow
              if DATABASES_KEY not in config:
                  raise IncorrectVersionError(
                      f"{file_name} has no valid keys"
                  )
  
          # UI export
          elif isinstance(config, list):
              # TODO (betodealmeida): validate with Marshmallow
              pass
  
          else:
              raise IncorrectVersionError(
                  f"{file_name} is not a valid file"
              )
  
          self._configs[file_name] = config
  
imports: import json
  import logging
  from typing import Any, Callable, Optional
  import yaml
  from flask_appbuilder import Model
  from sqlalchemy.orm import Session
  from sqlalchemy.orm.session import make_transient
  from superset import db
  from superset.commands.base import BaseCommand
  from superset.commands.database.exceptions import DatabaseNotFoundError
  from superset.commands.dataset.exceptions import DatasetInvalidError
  from superset.commands.importers.exceptions import IncorrectVersionError
  from superset.connectors.sqla.models import BaseDatasource, SqlaTable, SqlMetric, TableColumn
  from superset.models.core import Database
  from superset.utils.dict_import_export import DATABASES_KEY
label_desc: Use image node_id 3 for calling the ImportDatasetsCommand obj's underlying member method code with example usage: obj.validate() without return types