code: def _eager_op_object_factory(op_class, op_name):
      """Creates eager operator class to use with objective ops-like API. For completeness,
      currently not used.
      """
  
      class EagerOperator(op_class):
          def __init__(self, **kwargs):
              self._batch_size = getattr(kwargs, "batch_size", -1)
  
              # Workaround for batch size deduction in _prep_args as we don't have inputs yet.
              kwargs["batch_size"] = 0
  
              _, init_args, _ = _prep_args(
                  [],
                  kwargs,
                  op_name,
                  op_name,
                  _callable_op_factory.disqualified_arguments,
              )
              device_id = init_args.pop("device_id")
              init_args.pop("max_batch_size")
  
              super().__init__(**init_args)
  
              self._spec.AddArg("device_id", device_id)
              self.built = False
  
          def __call__(self, *inputs, **kwargs):
              inputs, init_args, call_args = _prep_args(
                  inputs,
                  kwargs,
                  op_name,
                  op_name,
                  _callable_op_factory.disqualified_arguments,
              )
  
              if not self.built:
                  num_outputs = self.schema.CalculateOutputs(
                      self._spec
                  ) + self.schema.CalculateAdditionalOutputs(self._spec)
  
                  self._spec.AddArg(
                      "max_batch_size", init_args["max_batch_size"]
                  )
                  self._backend_op = _create_backend_op(
                      self._spec,
                      self._device,
                      len(inputs),
                      num_outputs,
                      call_args.keys(),
                      op_name,
                  )
                  self.built = True
  
              output = self._backend_op(inputs, kwargs)
  
              if len(output) == 1:
                  return output[0]
  
              return output
  
      return EagerOperator
  
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 30 for calling a global function with example usage: _eager_op_object_factory(op_class, op_name) and returns: EagerOperator, output, output