class_docstr: Import datasources in YAML format.
  
  This is the original unversioned format used to export and import datasources
  in Superset.
code: def run(self) -> None:
      self.validate()
  
      # TODO (betodealmeida): add rollback in case of error
      for file_name, config in self._configs.items():
          logger.info("Importing dataset from file %s", file_name)
          if isinstance(config, dict):
              import_from_dict(db.session, config, sync=self.sync)
          else:  # list
              for dataset in config:
                  # UI exports don't have the database metadata, so we assume
                  # the DB exists and has the same name
                  params = json.loads(dataset["params"])
                  database = (
                      db.session.query(Database)
                      .filter_by(database_name=params["database_name"])
                      .one()
                  )
                  dataset["database_id"] = database.id
                  SqlaTable.import_from_dict(
                      db.session, dataset, sync=self.sync
                  )
  
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 2 for calling the ImportDatasetsCommand obj's underlying member method code with example usage: obj.run() without return types