code: def get_datasource(
      cls,
      session: Session,
      datasource_type: Union[DatasourceType, str],
      datasource_id: int,
  ) -> Datasource:
      if datasource_type not in cls.sources:
          raise DatasourceTypeNotSupportedError()
  
      datasource = (
          session.query(cls.sources[datasource_type])
          .filter_by(id=datasource_id)
          .one_or_none()
      )
  
      if not datasource:
          logger.warning(
              "Datasource not found datasource_type: %s, datasource_id: %s",
              datasource_type,
              datasource_id,
          )
          raise DatasourceNotFound()
  
      return datasource
  
file_path: superset/superset/daos/datasource.py
imports: import logging
  from typing import Union
  from sqlalchemy.orm import Session
  from superset.connectors.sqla.models import SqlaTable
  from superset.daos.base import BaseDAO
  from superset.daos.exceptions import DatasourceNotFound, DatasourceTypeNotSupportedError
  from superset.datasets.models import Dataset
  from superset.models.sql_lab import Query, SavedQuery
  from superset.tables.models import Table
  from superset.utils.core import DatasourceType
label_desc: Use image node_id 1 for calling the DatasourceDAO obj's underlying member method code with example usage: obj.get_datasource(cls, session, datasource_type, datasource_id) and returns: datasource