code: def method(
      meth: t.Callable[t.Concatenate[T, P], R] | None = None,
      *,
      batchable: bool = False,
      batch_dim: tuple[int, int] | int = 0,
      input_spec: AnyType | tuple[AnyType, ...] | None = None,
      output_spec: AnyType | None = None,
  ) -> (
      t.Callable[
          [t.Callable[t.Concatenate[T, P], R]], RunnableMethod[T, P, R]
      ]
      | RunnableMethod[T, P, R]
  ):
      def method_decorator(
          meth: t.Callable[t.Concatenate[T, P], R]
      ) -> RunnableMethod[T, P, R]:
          return RunnableMethod(
              meth,
              RunnableMethodConfig(
                  is_stream=inspect.isasyncgenfunction(meth)
                  or inspect.isgeneratorfunction(meth),
                  batchable=batchable,
                  batch_dim=(batch_dim, batch_dim)
                  if isinstance(batch_dim, int)
                  else batch_dim,
                  input_spec=input_spec,
                  output_spec=output_spec,
              ),
          )
  
      if callable(meth):
          return method_decorator(meth)
      return method_decorator
  
imports: from __future__ import annotations
  import inspect
  import logging
  import typing
  from typing import TYPE_CHECKING
  from typing import overload
  import attr
  from ...exceptions import BentoMLException
  from ..types import LazyType
label_desc: Use image node_id 6 for calling the Runnable obj's underlying member method code with example usage: obj.method(meth) and returns: method_decorator, RunnableMethod, method_decorator