code: def get_handler(self, name, case_sensitive=False):
      handler = self.handlers_cache.get(name)
      if handler is not None:
          return handler
  
      if case_sensitive:
          integration_record = (
              db.session.query(db.Integration)
              .filter_by(company_id=ctx.company_id, name=name)
              .first()
          )
      else:
          integration_record = (
              db.session.query(db.Integration)
              .filter(
                  (db.Integration.company_id == ctx.company_id)
                  & (
                      func.lower(db.Integration.name)
                      == func.lower(name)
                  )
              )
              .first()
          )
  
      integration_data = self._get_integration_record_data(
          integration_record, True
      )
      if integration_data is None:
          raise Exception(
              f"Can't find integration_record for handler '{name}'"
          )
      connection_data = integration_data.get("connection_data", {})
      integration_engine = integration_data["engine"]
      integration_name = integration_data["name"]
      logger.debug(
          "%s.get_handler: connection_data=%s, engine=%s",
          self.__class__.__name__,
          connection_data,
          integration_engine,
      )
  
      if integration_engine not in self.handler_modules:
          raise Exception(
              f"Can't find handler for '{integration_name}' ({integration_engine})"
          )
  
      integration_meta = self.handlers_import_status[integration_engine]
      if integration_meta["import"]["success"] is False:
          msg = dedent(
              f"""\
                  Handler '{integration_engine}' cannot be used. Reason is:
                      {integration_meta['import']['error_message']}
              """
          )
          is_cloud = Config().get("cloud", False)
          if is_cloud is False:
              msg += dedent(
                  f"""
  
                  If error is related to missing dependencies, then try to run command in shell and restart mindsdb:
                      pip install mindsdb[{integration_engine}]
                  """
              )
          logger.debug(msg)
          raise Exception(msg)
  
      connection_args = integration_meta.get("connection_args")
      logger.debug(
          "%s.get_handler: connection args - %s",
          self.__class__.__name__,
          connection_args,
      )
  
      file_storage = FileStorage(
          resource_group=RESOURCE_GROUP.INTEGRATION,
          resource_id=integration_record.id,
          sync=True,
      )
      handler_storage = HandlerStorage(integration_record.id)
  
      if isinstance(connection_args, (dict, OrderedDict)):
          files_to_get = {
              arg_name: arg_value
              for arg_name, arg_value in connection_data.items()
              if arg_name in connection_args
              and connection_args.get(arg_name)["type"] == ARG_TYPE.PATH
          }
          if len(files_to_get) > 0:
              for file_name, file_path in files_to_get.items():
                  connection_data[file_name] = file_storage.get_path(
                      file_path
                  )
  
      handler_ars = self._make_handler_args(
          name=name,
          handler_type=integration_engine,
          connection_data=connection_data,
          integration_id=integration_data["id"],
          file_storage=file_storage,
          handler_storage=handler_storage,
      )
  
      HandlerClass = self.handler_modules[integration_engine].Handler
  
      if integration_meta.get("type") == HANDLER_TYPE.ML:
          ml_handler_args = {
              "name": handler_ars["name"],
              "integration_id": handler_ars["integration_id"],
              "integration_engine": integration_engine,
              "handler_class": HandlerClass,
          }
          logger.info(
              "%s.get_handler: create a ML client, params - %s",
              self.__class__.__name__,
              ml_handler_args,
          )
          handler = BaseMLEngineExec(**ml_handler_args)
      else:
          logger.info(
              "%s.get_handler: create a client to db service of %s type, args - %s",
              self.__class__.__name__,
              integration_engine,
              handler_ars,
          )
          handler = HandlerClass(**handler_ars)
          # handler = DBClient(integration_engine, HandlerClass, **handler_ars)
          self.handlers_cache.set(handler)
  
      return handler
  
imports: import os
  import sys
  import base64
  import shutil
  import tempfile
  import importlib
  import threading
  import inspect
  import multiprocessing
  from time import time
  from pathlib import Path
  from copy import deepcopy
  from typing import Optional
  from textwrap import dedent
  from collections import OrderedDict
  from sqlalchemy import func
  from mindsdb.interfaces.storage import db
  from mindsdb.utilities.config import Config
  from mindsdb.interfaces.storage.fs import FsStore, FileStorage, RESOURCE_GROUP
  from mindsdb.interfaces.storage.model_fs import HandlerStorage
  from mindsdb.interfaces.file.file_controller import FileController
  from mindsdb.integrations.libs.base import DatabaseHandler
  from mindsdb.integrations.libs.base import BaseMLEngine
  from mindsdb.integrations.libs.api_handler import APIHandler
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE, HANDLER_TYPE
  from mindsdb.integrations.handlers_client.db_client_factory import DBClient
  from mindsdb.interfaces.model.functions import get_model_records
  from mindsdb.utilities.context import context
  from mindsdb.utilities import log
  from mindsdb.integrations.libs.ml_exec_base import BaseMLEngineExec
  import mindsdb.utilities.profiler
label_desc: Use image node_id 15 for calling the IntegrationController obj's underlying member method code with example usage: obj.get_handler(name, case_sensitive) and returns: handler, handler