code: def get_runnable(
      bento_model: bentoml.Model,
  ) -> t.Type[bentoml.Runnable]:
      """
      Private API: use :obj:`~bentoml.Model.to_runnable` instead.
      """
  
      class LightGBMRunnable(bentoml.Runnable):
          # LightGBM only supports GPU during training, not for inference.
          SUPPORTED_RESOURCES = ("cpu",)
          SUPPORTS_CPU_MULTI_THREADING = True
  
          def __init__(self):
              super().__init__()
              self.model = load_model(bento_model)
  
              self.predict_fns: dict[str, t.Callable[..., t.Any]] = {}
              for method_name in bento_model.info.signatures:
                  try:
                      self.predict_fns[method_name] = getattr(self.model, method_name)  # type: ignore (incomplete ligthgbm type stubs)
                  except AttributeError:
                      raise InvalidArgument(
                          f"No method with name {method_name} found for LightGBM model of type {self.model.__class__}"
                      )
  
      def add_runnable_method(
          method_name: str, options: ModelSignature
      ):
          def _run(
              self: LightGBMRunnable,
              input_data: ext.NpNDArray | ext.PdDataFrame,
          ) -> ext.NpNDArray:
              res = self.predict_fns[method_name](input_data)
              return np.asarray(res)  # type: ignore (unknown ndarray types)
  
          LightGBMRunnable.add_method(
              _run,
              name=method_name,
              batchable=options.batchable,
              batch_dim=options.batch_dim,
              input_spec=options.input_spec,
              output_spec=options.output_spec,
          )
  
      for method_name, options in bento_model.info.signatures.items():
          add_runnable_method(method_name, options)
  
      return LightGBMRunnable
  
file_path: BentoML/src/bentoml/_internal/frameworks/lightgbm.py
imports: from __future__ import annotations
  import logging
  import typing
  from types import ModuleType
  from typing import TYPE_CHECKING
  import numpy
  import bentoml
  from bentoml import Tag
  from bentoml.exceptions import InvalidArgument
  from bentoml.exceptions import MissingDependencyException
  from bentoml.exceptions import NotFound
  from ..models.model import ModelContext
  from ..utils.pkg import get_pkg_version
label_desc: Use image node_id 4 for calling a global function with example usage: get_runnable(bento_model) and returns: LightGBMRunnable, np