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'}"
docstr: merge dict ``a`` into dict ``b`` (non-inplace).
  
  Values in ``a`` will overwrite ``b``. ``b`` is copied first to avoid
  in-place modifications.
  
  Args:
      a (dict): The source dict to be merged into ``b``.
      b (dict): The origin dict to be fetch keys from ``a``.
      allow_list_keys (bool): If True, int string keys (e.g. '0', '1')
        are allowed in source ``a`` and will replace the element of the
        corresponding index in b if b is a list. Default: False.
  
  Returns:
      dict: The modified dict of ``b`` using ``a``.
  
  Examples:
      # Normally merge a into b.
      >>> Config._merge_a_into_b(
      ...     dict(obj=dict(a=2)), dict(obj=dict(a=1)))
      {'obj': {'a': 2}}
  
      # Delete b first and merge a into b.
      >>> Config._merge_a_into_b(
      ...     dict(obj=dict(_delete_=True, a=2)), dict(obj=dict(a=1)))
      {'obj': {'a': 2}}
  
      # b is a list
      >>> Config._merge_a_into_b(
      ...     {'0': dict(a=2)}, [dict(a=1), dict(b=2)], True)
      [{'a': 2}, {'b': 2}]
docstr_tok: ["merge","dict","``","a","``","into","dict","``","b","``","(","non-inplace",")",".","Values","in","``","a","``","will","overwrite","``","b","``",".","``","b","``","is","copied","first","to","avoid","in-place","modifications",".","Args",":","a","(","dict",")",":","The","source","dict","to","be","merged","into","``","b","``",".","b","(","dict",")",":","The","origin","dict","to","be","fetch","keys","from","``","a","``",".","allow_list_keys","(","bool",")",":","If","True",",","int","string","keys","(","e.g",".","'","0","'",",","'","1","'",")","are","allowed","in","source","``","a","``","and","will","replace","the","element","of","the","corresponding","index","in","b","if","b","is","a","list",".","Default",":","False",".","Returns",":","dict",":","The","modified","dict","of","``","b","``","using","``","a","``",".","Examples",":","#","Normally","merge","a","into","b",".",">",">",">","Config._merge_a_into_b","(","...","dict","(","obj=dict","(","a=2",")",")",",","dict","(","obj=dict","(","a=1",")",")",")","{","'obj","'",":","{","'","a","'",":","2","}","}","#","Delete","b","first","and","merge","a","into","b",".",">",">",">","Config._merge_a_into_b","(","...","dict","(","obj=dict","(","_delete_=True",",","a=2",")",")",",","dict","(","obj=dict","(","a=1",")",")",")","{","'obj","'",":","{","'","a","'",":","2","}","}","#","b","is","a","list",">",">",">","Config._merge_a_into_b","(","...","{","'","0","'",":","dict","(","a=2",")","}",",","[","dict","(","a=1",")",",","dict","(","b=2",")","]",",","True",")","[","{","'","a","'",":","2","}",",","{","'","b","'",":","2","}","]"]
code: def _merge_a_into_b(a, b, allow_list_keys=False):
      """merge dict ``a`` into dict ``b`` (non-inplace).
  
      Values in ``a`` will overwrite ``b``. ``b`` is copied first to avoid
      in-place modifications.
  
      Args:
          a (dict): The source dict to be merged into ``b``.
          b (dict): The origin dict to be fetch keys from ``a``.
          allow_list_keys (bool): If True, int string keys (e.g. '0', '1')
            are allowed in source ``a`` and will replace the element of the
            corresponding index in b if b is a list. Default: False.
  
      Returns:
          dict: The modified dict of ``b`` using ``a``.
  
      Examples:
          # Normally merge a into b.
          >>> Config._merge_a_into_b(
          ...     dict(obj=dict(a=2)), dict(obj=dict(a=1)))
          {'obj': {'a': 2}}
  
          # Delete b first and merge a into b.
          >>> Config._merge_a_into_b(
          ...     dict(obj=dict(_delete_=True, a=2)), dict(obj=dict(a=1)))
          {'obj': {'a': 2}}
  
          # b is a list
          >>> Config._merge_a_into_b(
          ...     {'0': dict(a=2)}, [dict(a=1), dict(b=2)], True)
          [{'a': 2}, {'b': 2}]
      """
      b = b.copy()
      for k, v in a.items():
          if allow_list_keys and k.isdigit() and isinstance(b, list):
              k = int(k)
              if len(b) <= k:
                  raise KeyError(
                      f"Index {k} exceeds the length of list {b}"
                  )
              b[k] = Config._merge_a_into_b(v, b[k], allow_list_keys)
          elif (
              isinstance(v, dict)
              and k in b
              and not v.pop(DELETE_KEY, False)
          ):
              allowed_types = (dict, list) if allow_list_keys else dict
              if not isinstance(b[k], allowed_types):
                  raise TypeError(
                      f"{k}={v} in child config cannot inherit from base "
                      f"because {k} is a dict in the child config but is of "
                      f"type {type(b[k])} in base config. You may set "
                      f"`{DELETE_KEY}=True` to ignore the base config"
                  )
              b[k] = Config._merge_a_into_b(v, b[k], allow_list_keys)
          else:
              b[k] = v
      return b
  
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 6 for calling the Config obj's underlying member method code with example usage: obj._merge_a_into_b(a, b, allow_list_keys) and returns: b