code: def get_model_records(
      integration_id=None,
      active=True,
      deleted_at=null(),
      project_name: Optional[str] = None,
      ml_handler_name: Optional[str] = None,
      **kwargs,
  ):
      kwargs["company_id"] = ctx.company_id
      if kwargs["company_id"] is None:
          kwargs["company_id"] = null()
  
      if deleted_at is not None:
          kwargs["deleted_at"] = deleted_at
      if active is not None:
          kwargs["active"] = active
  
      if project_name is not None:
          project_record = get_project_record(name=project_name)
          if project_record is None:
              return []
          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
  
      if integration_id is not None:
          kwargs["integration_id"] = integration_id
  
      return db.session.query(db.Predictor).filter_by(**kwargs).all()
  
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 5 for calling a global function with example usage: get_model_records(integration_id, active, deleted_at, project_name, ml_handler_name) and returns: db, list, list