code: def method_caller(
      framework_test_model: FrameworkTestModel,
      method: str,
      args: list[t.Any],
      kwargs: dict[str, t.Any],
  ):
      with tempfile.NamedTemporaryFile() as temp:
          onnx.save(framework_test_model.model, temp.name)
          ort_sess = ort.InferenceSession(
              temp.name, providers=["CPUExecutionProvider"]
          )
  
      def to_numpy(item):
          if isinstance(item, np.ndarray):
              pass
          elif isinstance(item, torch.Tensor):
              item = item.detach().to("cpu").numpy()
          return item
  
      input_names = {
          i.name: to_numpy(val)
          for i, val in zip(ort_sess.get_inputs(), args)
      }
      output_names = [o.name for o in ort_sess.get_outputs()]
      out = getattr(ort_sess, method)(output_names, input_names)[0]
      return out
  
imports: from __future__ import annotations
  import os
  import tempfile
  import typing
  from typing import TYPE_CHECKING
  import numpy
  import onnx
  import onnxruntime
  import sklearn
  import torch
  import torch.nn
  from skl2onnx import convert_sklearn
  from skl2onnx.common.data_types import FloatTensorType
  from skl2onnx.common.data_types import Int64TensorType
  from skl2onnx.common.data_types import StringTensorType
  from sklearn.datasets import load_iris
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import LabelEncoder
  import bentoml
  from .None import FrameworkTestModel
  from .None import FrameworkTestModelConfiguration
  from .None import FrameworkTestModelInput
label_desc: Use image node_id 1 for calling a global function with example usage: method_caller(framework_test_model, method, args, kwargs) and returns: out, item