code: def import_from_dict(session, data, sync=[]):
      
      if isinstance(data, dict):
          logging.info('Importing %d %s',
                       len(data.get(DATABASES_KEY, [])),
                       DATABASES_KEY)
          for database in data.get(DATABASES_KEY, []):
              Database.import_from_dict(session, database, sync=sync)
  
          logging.info('Importing %d %s',
                       len(data.get(DRUID_CLUSTERS_KEY, [])),
                       DRUID_CLUSTERS_KEY)
          for datasource in data.get(DRUID_CLUSTERS_KEY, []):
              DruidCluster.import_from_dict(session, datasource, sync=sync)
          session.commit()
      else:
          logging.info('Supplied object is not a dictionary.')
docs: Imports databases and druid clusters from dictionary