code: def _make_python_constructor(cls):
      def python_constructor(loader, node):
          if isinstance(node, yaml.SequenceNode):
              args = loader.construct_sequence(node, deep=True)
              return cls(*args)
          else:
              kwargs = loader.construct_mapping(node, deep=True)
              try:
                  return cls(**kwargs)
              except Exception as ex:
                  print(
                      "Error when construct {} instance from yaml config".format(
                          cls.__name__
                      )
                  )
                  raise ex
  
      return python_constructor
  
file_path: PaddleDetection/ppdet/core/config/yaml_helpers.py
imports: import importlib
  import inspect
  import yaml
  from .schema import SharedConfig
label_desc: Use image node_id 3 for calling a global function with example usage: _make_python_constructor(cls) and returns: python_constructor, cls, cls