class_docstr: A facility for config and config files.
  
  It supports common file formats as configs: python/json/yaml. The interface
  is the same as a dict object and also allows access config values as
  attributes.
  
  Example:
      >>> cfg = Config(dict(a=1, b=dict(b1=[0, 1])))
      >>> cfg.a
      1
      >>> cfg.b
      {'b1': [0, 1]}
      >>> cfg.b.b1
      [0, 1]
      >>> cfg = Config.fromfile('tests/data/config/a.py')
      >>> cfg.filename
      "/home/kchen/projects/mmcv/tests/data/config/a.py"
      >>> cfg.item4
      'test'
      >>> cfg
      "Config [path: /home/kchen/projects/mmcv/tests/data/config/a.py]: "
      "{'item1': [1, 2], 'item2': {'a': 0}, 'item3': True, 'item4': 'test'}"
code: def pretty_text(self):
      indent = 4
  
      def _indent(s_, num_spaces):
          s = s_.split("\n")
          if len(s) == 1:
              return s_
          first = s.pop(0)
          s = [(num_spaces * " ") + line for line in s]
          s = "\n".join(s)
          s = first + "\n" + s
          return s
  
      def _format_basic_types(k, v, use_mapping=False):
          if isinstance(v, str):
              v_str = f"'{v}'"
          else:
              v_str = str(v)
  
          if use_mapping:
              k_str = f"'{k}'" if isinstance(k, str) else str(k)
              attr_str = f"{k_str}: {v_str}"
          else:
              attr_str = f"{str(k)}={v_str}"
          attr_str = _indent(attr_str, indent)
  
          return attr_str
  
      def _format_list(k, v, use_mapping=False):
          # check if all items in the list are dict
          if all(isinstance(_, dict) for _ in v):
              v_str = "[\n"
              v_str += "\n".join(
                  f"dict({_indent(_format_dict(v_), indent)}),"
                  for v_ in v
              ).rstrip(",")
              if use_mapping:
                  k_str = f"'{k}'" if isinstance(k, str) else str(k)
                  attr_str = f"{k_str}: {v_str}"
              else:
                  attr_str = f"{str(k)}={v_str}"
              attr_str = _indent(attr_str, indent) + "]"
          else:
              attr_str = _format_basic_types(k, v, use_mapping)
          return attr_str
  
      def _contain_invalid_identifier(dict_str):
          contain_invalid_identifier = False
          for key_name in dict_str:
              contain_invalid_identifier |= not str(
                  key_name
              ).isidentifier()
          return contain_invalid_identifier
  
      def _format_dict(input_dict, outest_level=False):
          r = ""
          s = []
  
          use_mapping = _contain_invalid_identifier(input_dict)
          if use_mapping:
              r += "{"
          for idx, (k, v) in enumerate(input_dict.items()):
              is_last = idx >= len(input_dict) - 1
              end = "" if outest_level or is_last else ","
              if isinstance(v, dict):
                  v_str = "\n" + _format_dict(v)
                  if use_mapping:
                      k_str = f"'{k}'" if isinstance(k, str) else str(k)
                      attr_str = f"{k_str}: dict({v_str}"
                  else:
                      attr_str = f"{str(k)}=dict({v_str}"
                  attr_str = _indent(attr_str, indent) + ")" + end
              elif isinstance(v, list):
                  attr_str = _format_list(k, v, use_mapping) + end
              else:
                  attr_str = (
                      _format_basic_types(k, v, use_mapping) + end
                  )
  
              s.append(attr_str)
          r += "\n".join(s)
          if use_mapping:
              r += "}"
          return r
  
      cfg_dict = self._cfg_dict.to_dict()
      text = _format_dict(cfg_dict, outest_level=True)
      # copied from setup.cfg
      yapf_style = dict(
          based_on_style="pep8",
          blank_line_before_nested_class_or_def=True,
          split_before_expression_after_opening_paren=True,
      )
      text, _ = FormatCode(text, style_config=yapf_style, verify=True)
  
      return text
  
imports: import ast
  import copy
  import os
  import os.path
  import platform
  import shutil
  import sys
  import tempfile
  import uuid
  import warnings
  from argparse import Action, ArgumentParser
  from collections import abc
  from importlib import import_module
  from addict import Dict
  from yapf.yapflib.yapf_api import FormatCode
  from .misc import import_modules_from_strings
  from .path import check_file_exist
label_desc: Use image node_id 13 for calling the Config obj's underlying member method code with example usage: obj.pretty_text() and returns: text, s, attr_str, attr_str, contain_invalid_identifier, r, s_