nodes: 0, module; 1, function_definition; 2, function_name:_do_parse; 3, parameters; 4, block; 5, identifier:inp; 6, identifier:fmt; 7, identifier:encoding; 8, identifier:force_types; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, comment:# make sure it's all unicode and all int/float values were parsed correctly; 14, comment:#   the unicode part is here because of yaml on PY2 and also as workaround for; 15, comment:#   https://github.com/DiffSK/configobj/issues/18#issuecomment-76391689; 16, return_statement; 17, comment:"""Actually parse input.
  
      Args:
          inp: bytes yielding file-like object
          fmt: format to use for parsing
          encoding: encoding of `inp`
          force_types:
              if `True`, integers, floats, booleans and none/null
                  are recognized and returned as proper types instead of strings;
              if `False`, everything is converted to strings
              if `None`, backend return value is used
      Returns:
          parsed `inp` (dict or list) containing unicode values
      Raises:
          various sorts of errors raised by used libraries while parsing
      """; 18, assignment; 19, call; 20, comparison_operator:fmt == 'ini'; 21, block; 22, elif_clause; 23, elif_clause; 24, elif_clause; 25, elif_clause; 26, elif_clause; 27, else_clause; 28, call; 29, identifier:res; 30, dictionary; 31, identifier:_check_lib_installed; 32, argument_list; 33, identifier:fmt; 34, string; 35, expression_statement; 36, expression_statement; 37, comparison_operator:fmt == 'json'; 38, block; 39, comparison_operator:fmt == 'json5'; 40, block; 41, comparison_operator:fmt == 'toml'; 42, block; 43, comparison_operator:fmt == 'xml'; 44, block; 45, comparison_operator:fmt == 'yaml'; 46, comment:# guesses encoding by its own, there seems to be no way to pass; 47, comment:#  it explicitly; 48, block; 49, block; 50, identifier:_ensure_proper_types; 51, argument_list; 52, identifier:fmt; 53, string; 54, string_content:ini; 55, assignment; 56, assignment; 57, identifier:fmt; 58, string; 59, if_statement; 60, expression_statement; 61, identifier:fmt; 62, string; 63, if_statement; 64, expression_statement; 65, identifier:fmt; 66, string; 67, if_statement; 68, if_statement; 69, expression_statement; 70, identifier:fmt; 71, string; 72, expression_statement; 73, identifier:fmt; 74, string; 75, expression_statement; 76, raise_statement; 77, comment:# unknown format; 78, identifier:res; 79, identifier:encoding; 80, identifier:force_types; 81, string_content:parse; 82, identifier:cfg; 83, call; 84, identifier:res; 85, call; 86, string_content:json; 87, attribute; 88, comment:# python 3 json only reads from unicode objects; 89, block; 90, assignment; 91, string_content:json5; 92, attribute; 93, block; 94, assignment; 95, string_content:toml; 96, not_operator; 97, block; 98, attribute; 99, comment:# python 3 toml prefers unicode objects; 100, block; 101, assignment; 102, string_content:xml; 103, assignment; 104, string_content:yaml; 105, assignment; 106, attribute; 107, argument_list; 108, attribute; 109, argument_list; 110, identifier:six; 111, identifier:PY3; 112, expression_statement; 113, identifier:res; 114, call; 115, identifier:six; 116, identifier:PY3; 117, expression_statement; 118, identifier:res; 119, call; 120, call; 121, raise_statement; 122, identifier:six; 123, identifier:PY3; 124, expression_statement; 125, identifier:res; 126, call; 127, identifier:res; 128, call; 129, identifier:res; 130, call; 131, identifier:configobj; 132, identifier:ConfigObj; 133, identifier:inp; 134, keyword_argument; 135, identifier:cfg; 136, identifier:dict; 137, assignment; 138, attribute; 139, argument_list; 140, assignment; 141, attribute; 142, argument_list; 143, identifier:_is_utf8; 144, argument_list; 145, call; 146, assignment; 147, attribute; 148, argument_list; 149, attribute; 150, argument_list; 151, attribute; 152, argument_list; 153, identifier:encoding; 154, identifier:encoding; 155, identifier:inp; 156, call; 157, identifier:json; 158, identifier:load; 159, identifier:inp; 160, keyword_argument; 161, identifier:inp; 162, call; 163, identifier:json5; 164, identifier:load; 165, identifier:inp; 166, keyword_argument; 167, identifier:encoding; 168, identifier:AnyMarkupError; 169, argument_list; 170, identifier:inp; 171, call; 172, identifier:toml; 173, identifier:load; 174, identifier:inp; 175, identifier:xmltodict; 176, identifier:parse; 177, identifier:inp; 178, keyword_argument; 179, identifier:yaml; 180, identifier:safe_load; 181, identifier:inp; 182, attribute; 183, argument_list; 184, identifier:encoding; 185, identifier:encoding; 186, attribute; 187, argument_list; 188, identifier:encoding; 189, identifier:encoding; 190, string; 191, attribute; 192, argument_list; 193, identifier:encoding; 194, identifier:encoding; 195, identifier:io; 196, identifier:TextIOWrapper; 197, identifier:inp; 198, keyword_argument; 199, identifier:io; 200, identifier:TextIOWrapper; 201, identifier:inp; 202, keyword_argument; 203, string_content:toml is always utf-8 encoded according to specification; 204, identifier:io; 205, identifier:TextIOWrapper; 206, identifier:inp; 207, keyword_argument; 208, identifier:encoding; 209, identifier:encoding; 210, identifier:encoding; 211, identifier:encoding; 212, identifier:encoding; 213, identifier:encoding
code: def _do_parse(inp, fmt, encoding, force_types):
      """Actually parse input.
  
      Args:
          inp: bytes yielding file-like object
          fmt: format to use for parsing
          encoding: encoding of `inp`
          force_types:
              if `True`, integers, floats, booleans and none/null
                  are recognized and returned as proper types instead of strings;
              if `False`, everything is converted to strings
              if `None`, backend return value is used
      Returns:
          parsed `inp` (dict or list) containing unicode values
      Raises:
          various sorts of errors raised by used libraries while parsing
      """
      res = {}
      _check_lib_installed(fmt, 'parse')
  
      if fmt == 'ini':
          cfg = configobj.ConfigObj(inp, encoding=encoding)
          res = cfg.dict()
      elif fmt == 'json':
          if six.PY3:
              # python 3 json only reads from unicode objects
              inp = io.TextIOWrapper(inp, encoding=encoding)
          res = json.load(inp, encoding=encoding)
      elif fmt == 'json5':
          if six.PY3:
              inp = io.TextIOWrapper(inp, encoding=encoding)
          res = json5.load(inp, encoding=encoding)
      elif fmt == 'toml':
          if not _is_utf8(encoding):
              raise AnyMarkupError('toml is always utf-8 encoded according to specification')
          if six.PY3:
              # python 3 toml prefers unicode objects
              inp = io.TextIOWrapper(inp, encoding=encoding)
          res = toml.load(inp)
      elif fmt == 'xml':
          res = xmltodict.parse(inp, encoding=encoding)
      elif fmt == 'yaml':
          # guesses encoding by its own, there seems to be no way to pass
          #  it explicitly
          res = yaml.safe_load(inp)
      else:
          raise  # unknown format
  
      # make sure it's all unicode and all int/float values were parsed correctly
      #   the unicode part is here because of yaml on PY2 and also as workaround for
      #   https://github.com/DiffSK/configobj/issues/18#issuecomment-76391689
      return _ensure_proper_types(res, encoding, force_types)