code: def _is_generator_function(x):
      """Checks whether x is a generator function or a callable object
      where __call__ is a generator function"""
      if inspect.isgeneratorfunction(x):
          return True
      if isinstance(x, functools.partial):
          return _is_generator_function(x.func)
  
      if x is None or inspect.isfunction(x) or inspect.ismethod(x):
          return False
      call = getattr(x, "__call__", None)
      if call is x:
          return False
      return _is_generator_function(call)
  
imports: from enum import Enum
  from nvidia.dali import types
  from nvidia.dali import tensors
  import inspect
  import functools
label_desc: Use image node_id 6 for calling a global function with example usage: _is_generator_function(x) and returns: _is_generator_function, True, _is_generator_function, False, False