code: def get_runnable(bento_model: Model):
      """
      Private API: use :obj:`~bentoml.Model.to_runnable` instead.
      """
  
      partial_kwargs: t.Dict[str, t.Any] = bento_model.info.options.partial_kwargs  # type: ignore
  
      class PicklableRunnable(bentoml.Runnable):
          SUPPORTED_RESOURCES = ("cpu",)
          SUPPORTS_CPU_MULTI_THREADING = False
  
          def __init__(self):
              super().__init__()
              self.model = load_model(bento_model)
  
      def _get_run(
          method_name: str,
          partial_kwargs: t.Dict[str, t.Any] | None = None,
      ):
          if partial_kwargs is None:
              partial_kwargs = {}
  
          def _run(
              self: PicklableRunnable,
              *args: ext.NpNDArray | ext.PdDataFrame,
              **kwargs: ext.NpNDArray | ext.PdDataFrame,
          ) -> ext.NpNDArray:
              assert isinstance(method_name, str), repr(method_name)
              return getattr(self.model, method_name)(
                  *args, **dict(partial_kwargs, **kwargs)
              )
  
          return _run
  
      for method_name, options in bento_model.info.signatures.items():
          assert isinstance(method_name, str), repr(method_name)
          method_partial_kwargs = partial_kwargs.get(method_name)
          PicklableRunnable.add_method(
              _get_run(method_name, method_partial_kwargs),
              name=method_name,
              batchable=options.batchable,
              batch_dim=options.batch_dim,
              input_spec=options.input_spec,
              output_spec=options.output_spec,
          )
  
      return PicklableRunnable
  
file_path: BentoML/grpc-client/bentoml/_internal/frameworks/picklable.py
imports: from __future__ import annotations
  import logging
  import typing
  from types import ModuleType
  from typing import TYPE_CHECKING
  import cloudpickle
  import bentoml
  from bentoml import Tag
  from bentoml.exceptions import NotFound
  from bentoml.models import Model
  from bentoml.models import ModelContext
  from ..models import PKL_EXT
  from ..models import SAVE_NAMESPACE
  from ..models.model import ModelSignature
  from ..models.model import PartialKwargsModelOptions
label_desc: Use image node_id 4 for calling a global function with example usage: get_runnable(bento_model) and returns: PicklableRunnable, _run, getattr