code: def _wrap_stateful(op_class, op_name, wrapper_name):
      """Wraps stateful Eager Operator as method of a class. Callable the same way as functions in
      fn API, but directly with TensorLists.
      """
  
      def wrapper(self, *inputs, **kwargs):
          inputs, init_args, call_args = _prep_args(
              inputs,
              kwargs,
              op_name,
              wrapper_name,
              _callable_op_factory.disqualified_arguments,
          )
  
          key = _gen_cache_key(op_name, inputs, init_args, call_args)
  
          if key not in self._operator_cache:
              # Creating a new operator instance with deterministically generated seed, so if we
              # preserve the order of operator calls in different instances of rng_state, they
              # return the same results.
              seed = self._seed_generator.integers(
                  _wrap_stateful.seed_upper_bound
              )
              self._operator_cache[key] = _callable_op_factory(
                  op_class, wrapper_name, len(inputs), call_args.keys()
              )(**init_args, seed=seed)
  
          return self._operator_cache[key](inputs, call_args)
  
      return wrapper
  
imports: import sys
  from nvidia.dali import backend
  from nvidia.dali import internal
  from nvidia.dali import ops
  from nvidia.dali import tensors
  from nvidia.dali import types
  from nvidia.dali.external_source import _prep_data_for_feed_input
label_desc: Use image node_id 44 for calling a global function with example usage: _wrap_stateful(op_class, op_name, wrapper_name) and returns: wrapper, self