code: def _default_repr(self):
      """
      Produce something like:
      "imgaug.MyAugmentor(field1={self.field1}, field2={self.field2})"
  
      It assumes that the instance `self` contains attributes that match its constructor.
      """
      classname = type(self).__name__
      argspec = inspect.getfullargspec(self.__init__)
      assert (
          argspec.varargs is None
      ), "The default __repr__ in {} doesn't work for varargs!".format(
          classname
      )
      assert (
          argspec.varkw is None
      ), "The default __repr__ in {} doesn't work for kwargs!".format(
          classname
      )
      defaults = {}
  
      fields = argspec.args[1:]
      defaults_pos = argspec.defaults
      if defaults_pos is not None:
          for f, d in zip(fields[::-1], defaults_pos[::-1]):
              defaults[f] = d
  
      for k in argspec.kwonlyargs:
          fields.append(k)
          if k in argspec.kwonlydefaults:
              defaults[k] = argspec.kwonlydefaults[k]
  
      argstr = []
      for f in fields:
          assert hasattr(self, f), (
              "Attribute {} in {} not found! Default __repr__ only works if "
              "the instance has attributes that match the constructor.".format(
                  f, classname
              )
          )
          attr = getattr(self, f)
          if f in defaults and attr is defaults[f]:
              continue
          argstr.append("{}={}".format(f, pprint.pformat(attr)))
      return "imgaug.{}({})".format(classname, ", ".join(argstr))
  
imports: import os
  import inspect
  import pprint
  from collections import namedtuple
  import weakref
  from ...utils.argtools import log_once
  from ...utils.utils import get_rng
  from ...utils.develop import deprecated
  from ..image import check_dtype
label_desc: Use image node_id 2 for calling a global function with example usage: _default_repr() and returns: str