code: def _make_python_representer(cls):
      # python 2 compatibility
      if hasattr(inspect, "getfullargspec"):
          argspec = inspect.getfullargspec(cls)
      else:
          argspec = inspect.getfullargspec(cls.__init__)
      argnames = [arg for arg in argspec.args if arg != "self"]
  
      def python_representer(dumper, obj):
          if argnames:
              data = {name: getattr(obj, name) for name in argnames}
          else:
              data = obj.__dict__
          if "_id" in data:
              del data["_id"]
          return dumper.represent_mapping(
              "!{}".format(cls.__name__), data
          )
  
      return python_representer
  
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 4 for calling a global function with example usage: _make_python_representer(cls) and returns: python_representer, dumper