code: def inject_implicit_scope_argument(schema, kwargs):
      """
      Adds hidden _scope argument to the inputless operators whose outputs for
      any given sample depend on the actual batch size, e.g. fn.batch_permutation.
      """
      # TODO(ktokarski) Consider optimizing the case - the implicit `_scope` argument is not
      # needed if operator can accept any other positional/tensor argument and any such
      # arg was specified. For now, the ops that use the _scope arg (ImplicitScopeAttr schema)
      # do not have any other tensor inputs.
      if schema.HasArgument("_scope"):
          conditional_scope = this_condition_stack()
          scope_masked_batch = (
              conditional_scope.scope_batch_size_tracker()
          )
          kwargs["_scope"] = scope_masked_batch
  
imports: from nvidia.dali import _autograph
  from nvidia.dali.data_node import DataNode
  from nvidia.dali import fn
  from nvidia.dali._autograph.utils import ag_logging
  from nvidia.dali._autograph.operators import variables
  from contextlib import contextmanager
  from enum import Enum
  import tree
label_desc: Use image node_id 9 for calling a global function with example usage: inject_implicit_scope_argument(schema, kwargs) without return types