code: def get_model_record(
      except_absent=False,
      ml_handler_name: Optional[str] = None,
      project_name: Optional[str] = None,
      active: bool = True,
      deleted_at=null(),
      version: Optional[int] = None,
      **kwargs,
  ):
      kwargs["company_id"] = ctx.company_id
      if kwargs["company_id"] is None:
          kwargs["company_id"] = null()
  
      kwargs["deleted_at"] = deleted_at
      if active is not None:
          kwargs["active"] = active
      if version is not None:
          kwargs["version"] = version
  
      if project_name is not None:
          project_record = get_project_record(name=project_name)
          if project_record is None:
              return None
          kwargs["project_id"] = project_record.id
  
      if ml_handler_name is not None:
          ml_handler_record = get_integration_record(
              name=ml_handler_name
          )
          if ml_handler_record is None:
              # raise Exception(f'unknown ml handler: {ml_handler_name}')
              return []
          kwargs["integration_id"] = ml_handler_record.id
  
      records = db.session.query(db.Predictor).filter_by(**kwargs).all()
      if len(records) > 1:
          raise MultiplePredictorRecordsFound(**kwargs)
      if len(records) == 0:
          if except_absent is True:
              raise PredictorRecordNotFound(**kwargs)
          else:
              return None
      return records[0]
  
file_path: mindsdb/mindsdb/interfaces/model/functions.py
imports: from typing import Optional
  from sqlalchemy import null, func
  import mindsdb.interfaces.storage.db
  from mindsdb.utilities.context import context
  import mindsdb.utilities.profiler
label_desc: Use image node_id 6 for calling a global function with example usage: get_model_record(except_absent, ml_handler_name, project_name, active, deleted_at, version) and returns: records, None, list, None