class_docstr: Base class for all nested objects in doctr
class_docstr_tok: ["Base","class","for","all","nested","objects","in","doctr"]
code: def __repr__(self):
      # We treat the extra repr like the sub-object, one item per line
      extra_lines = []
      extra_repr = self.extra_repr()
      # empty string will be split into list ['']
      if extra_repr:
          extra_lines = extra_repr.split("\n")
      child_lines = []
      if hasattr(self, "_children_names"):
          for key in self._children_names:
              child = getattr(self, key)
              if isinstance(child, list) and len(child) > 0:
                  child_str = ",\n".join(
                      [repr(subchild) for subchild in child]
                  )
                  if len(child) > 1:
                      child_str = (
                          _addindent(f"\n{child_str},", 2) + "\n"
                      )
                  child_str = f"[{child_str}]"
              else:
                  child_str = repr(child)
              child_str = _addindent(child_str, 2)
              child_lines.append("(" + key + "): " + child_str)
      lines = extra_lines + child_lines
  
      main_str = self.__class__.__name__ + "("
      if lines:
          # simple one-liner info, which most builtin Modules will use
          if len(extra_lines) == 1 and not child_lines:
              main_str += extra_lines[0]
          else:
              main_str += "\n  " + "\n  ".join(lines) + "\n"
  
      main_str += ")"
      return main_str
  
imports: from typing import List
label_desc: Use image node_id 2 for calling the NestedObject obj's underlying member method code with example usage: obj.__repr__() and returns: main_str