class_docstr: argparse action to split an argument into KEY=VALUE form
  on the first = and append to a dictionary. List options can
  be passed as comma separated values, i.e 'KEY=V1,V2,V3', or with explicit
  brackets, i.e. 'KEY=[V1,V2,V3]'. It also support nested brackets to build
  list/tuple values. e.g. 'KEY=[(V1,V2),(V3,V4)]'
docstr: Parse iterable values in the string.
  
  All elements inside '()' or '[]' are treated as iterable values.
  
  Args:
      val (str): Value string.
  
  Returns:
      list | tuple: The expanded list or tuple from the string.
  
  Examples:
      >>> DictAction._parse_iterable('1,2,3')
      [1, 2, 3]
      >>> DictAction._parse_iterable('[a, b, c]')
      ['a', 'b', 'c']
      >>> DictAction._parse_iterable('[(1, 2, 3), [a, b], c]')
      [(1, 2, 3), ['a', 'b'], 'c']
docstr_tok: ["Parse","iterable","values","in","the","string",".","All","elements","inside","'","(",")","'","or","'","[","]","'","are","treated","as","iterable","values",".","Args",":","val","(","str",")",":","Value","string",".","Returns",":","list","|","tuple",":","The","expanded","list","or","tuple","from","the","string",".","Examples",":",">",">",">","DictAction._parse_iterable","(","'","1,2,3","'",")","[","1",",","2",",","3","]",">",">",">","DictAction._parse_iterable","(","'","[","a",",","b",",","c","]","'",")","[","'","a","'",",","'","b","'",",","'","c","'","]",">",">",">","DictAction._parse_iterable","(","'","[","(","1",",","2",",","3",")",",","[","a",",","b","]",",","c","]","'",")","[","(","1",",","2",",","3",")",",","[","'","a","'",",","'","b","'","]",",","'","c","'","]"]
code: def _parse_iterable(val):
      """Parse iterable values in the string.
  
      All elements inside '()' or '[]' are treated as iterable values.
  
      Args:
          val (str): Value string.
  
      Returns:
          list | tuple: The expanded list or tuple from the string.
  
      Examples:
          >>> DictAction._parse_iterable('1,2,3')
          [1, 2, 3]
          >>> DictAction._parse_iterable('[a, b, c]')
          ['a', 'b', 'c']
          >>> DictAction._parse_iterable('[(1, 2, 3), [a, b], c]')
          [(1, 2, 3), ['a', 'b'], 'c']
      """
  
      def find_next_comma(string):
          """Find the position of next comma in the string.
  
          If no ',' is found in the string, return the string length. All
          chars inside '()' and '[]' are treated as one element and thus ','
          inside these brackets are ignored.
          """
          assert (string.count("(") == string.count(")")) and (
              string.count("[") == string.count("]")
          ), f"Imbalanced brackets exist in {string}"
          end = len(string)
          for idx, char in enumerate(string):
              pre = string[:idx]
              # The string before this ',' is balanced
              if (
                  (char == ",")
                  and (pre.count("(") == pre.count(")"))
                  and (pre.count("[") == pre.count("]"))
              ):
                  end = idx
                  break
          return end
  
      # Strip ' and " characters and replace whitespace.
      val = val.strip("'\"").replace(" ", "")
      is_tuple = False
      if val.startswith("(") and val.endswith(")"):
          is_tuple = True
          val = val[1:-1]
      elif val.startswith("[") and val.endswith("]"):
          val = val[1:-1]
      elif "," not in val:
          # val is a single value
          return DictAction._parse_int_float_bool(val)
  
      values = []
      while len(val) > 0:
          comma_idx = find_next_comma(val)
          element = DictAction._parse_iterable(val[:comma_idx])
          values.append(element)
          val = val[comma_idx + 1 :]
      if is_tuple:
          values = tuple(values)
      return values
  
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 2 for calling the DictAction obj's underlying member method code with example usage: obj._parse_iterable(val) and returns: values, end, DictAction