code: def function_by_value_reducer(fun):
      cl_vars = inspect.getclosurevars(fun)
      code = marshal.dumps(fun.__code__)
      basic_def = (
          fun.__name__,
          fun.__qualname__,
          code,
          fun.__closure__,
      )
      global_refs = dict(cl_vars.globals)
      get_global_references_from_nested_code(
          fun.__code__, fun.__globals__, global_refs
      )
      fun_context = {
          "global_refs": global_refs,
          "defaults": fun.__defaults__,
          "kwdefaults": fun.__kwdefaults__,
      }
      return (
          function_unpickle,
          basic_def,
          fun_context,
          None,
          None,
          set_funcion_state,
      )
  
file_path: DALI/dali/python/nvidia/dali/reducers.py
imports: import inspect
  import pickle
  import sys
  import types
  import marshal
  import importlib
label_desc: Use image node_id 5 for calling a global function with example usage: function_by_value_reducer(fun) and returns: function_unpickle,  basic_def,  fun_context,  None,  None,  set_funcion_state