code: def predict_process(payload, dataframe):
      db.init()
      integration_id = payload["handler_meta"]["integration_id"]
      predictor_record = payload["predictor_record"]
      args = payload["args"]
      module_path = payload["handler_meta"]["module_path"]
      class_name = payload["handler_meta"]["class_name"]
      ml_engine_name = payload["handler_meta"]["engine"]
  
      module = importlib.import_module(module_path)
      HandlerClass = getattr(module, class_name)
      handler_class = HandlerClass
  
      if predictor_record.id not in handlers_cacher:
          handlerStorage = HandlerStorage(integration_id)
          modelStorage = ModelStorage(predictor_record.id)
          ml_handler = handler_class(
              engine_storage=handlerStorage,
              model_storage=modelStorage,
          )
          handlers_cacher[predictor_record.id] = ml_handler
      else:
          ml_handler = handlers_cacher[predictor_record.id]
  
      if ml_engine_name == "lightwood":
          args["code"] = predictor_record.code
          args["target"] = predictor_record.to_predict[0]
          args["dtype_dict"] = predictor_record.dtype_dict
          args["learn_args"] = predictor_record.learn_args
  
      if ml_engine_name == "langchain":
          from mindsdb.api.executor.controllers import SessionController
          from mindsdb.api.executor.command_executor import (
              ExecuteCommands,
          )
  
          sql_session = SessionController()
          sql_session.database = "mindsdb"
  
          command_executor = ExecuteCommands(sql_session)
  
          args["executor"] = command_executor
  
      predictions = ml_handler.predict(dataframe, args)
      ml_handler.close()
      return predictions
  
imports: import time
  import importlib
  import traceback
  import datetime
  from collections import UserDict
  from mindsdb_sql import parse_sql
  from mindsdb_sql.parser.ast import Identifier, Select, Star, NativeQuery
  import mindsdb.interfaces.storage.db
  from mindsdb.api.executor import SQLQuery
  from mindsdb.integrations.utilities.sql_utils import make_sql_session
  from mindsdb.integrations.libs.const import PREDICTOR_STATUS
  from mindsdb.interfaces.storage.model_fs import ModelStorage, HandlerStorage
  from mindsdb.interfaces.model.functions import get_model_records
  from mindsdb.integrations.utilities.utils import format_exception_error
  import mindsdb.utilities.profiler
  from mindsdb.utilities.functions import mark_process
  from mindsdb.utilities.context import context
  from mindsdb.utilities.config import Config
  from mindsdb.utilities import log
label_desc: Use image node_id 1 for calling a global function with example usage: predict_process(payload, dataframe) and returns: predictions