nodes: 0, module; 1, function_definition; 2, function_name:read_conf; 3, parameters; 4, block; 5, identifier:conf_file; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, with_statement; 11, if_statement; 12, return_statement; 13, identifier:out_format; 14, string; 15, string; 16, assignment; 17, assignment; 18, with_clause; 19, block; 20, comparison_operator:out_format == 'simple'; 21, block; 22, identifier:ret_commented; 23, string_content:simple; 24, string_content:Read in an LXC configuration file. By default returns a simple, unsorted
      dict, but can also return a more detailed structure including blank lines
      and comments.
  
      out_format:
          set to 'simple' if you need the old and unsupported behavior.
          This won't support the multiple lxc values (eg: multiple network nics)
  
      CLI Examples:
  
      .. code-block:: bash
  
          salt 'minion' lxc.read_conf /etc/lxc/mycontainer.conf
          salt 'minion' lxc.read_conf /etc/lxc/mycontainer.conf out_format=commented; 25, identifier:ret_commented; 26, list; 27, identifier:ret_simple; 28, dictionary; 29, with_item; 30, for_statement; 31, identifier:out_format; 32, string; 33, return_statement; 34, as_pattern; 35, identifier:line; 36, call; 37, block; 38, string_content:simple; 39, identifier:ret_simple; 40, call; 41, as_pattern_target; 42, attribute; 43, argument_list; 44, if_statement; 45, expression_statement; 46, expression_statement; 47, expression_statement; 48, if_statement; 49, attribute; 50, argument_list; 51, identifier:fp_; 52, attribute; 53, identifier:decode; 54, call; 55, comparison_operator:'=' not in line; 56, block; 57, assignment; 58, assignment; 59, assignment; 60, call; 61, block; 62, else_clause; 63, attribute; 64, identifier:fopen; 65, identifier:conf_file; 66, string; 67, attribute; 68, identifier:data; 69, attribute; 70, argument_list; 71, string; 72, identifier:line; 73, expression_statement; 74, continue_statement; 75, identifier:comps; 76, call; 77, identifier:value; 78, call; 79, identifier:comment; 80, None; 81, attribute; 82, argument_list; 83, expression_statement; 84, expression_statement; 85, expression_statement; 86, expression_statement; 87, block; 88, attribute; 89, identifier:files; 90, string_content:r; 91, identifier:salt; 92, identifier:utils; 93, identifier:fp_; 94, identifier:readlines; 95, string_content:=; 96, call; 97, attribute; 98, argument_list; 99, attribute; 100, argument_list; 101, call; 102, identifier:startswith; 103, string; 104, assignment; 105, assignment; 106, assignment; 107, call; 108, expression_statement; 109, expression_statement; 110, identifier:salt; 111, identifier:utils; 112, attribute; 113, argument_list; 114, identifier:line; 115, identifier:split; 116, string; 117, call; 118, identifier:strip; 119, attribute; 120, argument_list; 121, string_content:#; 122, identifier:vcomps; 123, call; 124, identifier:value; 125, call; 126, identifier:comment; 127, call; 128, attribute; 129, argument_list; 130, call; 131, assignment; 132, identifier:ret_commented; 133, identifier:append; 134, identifier:line; 135, string_content:=; 136, attribute; 137, argument_list; 138, identifier:value; 139, identifier:strip; 140, attribute; 141, argument_list; 142, attribute; 143, argument_list; 144, attribute; 145, argument_list; 146, identifier:ret_commented; 147, identifier:append; 148, dictionary; 149, attribute; 150, argument_list; 151, subscript; 152, identifier:value; 153, string; 154, identifier:join; 155, subscript; 156, call; 157, identifier:split; 158, string; 159, subscript; 160, identifier:strip; 161, call; 162, identifier:strip; 163, pair; 164, identifier:ret_commented; 165, identifier:append; 166, dictionary; 167, identifier:ret_simple; 168, call; 169, string_content:=; 170, identifier:comps; 171, slice; 172, attribute; 173, argument_list; 174, string_content:#; 175, identifier:vcomps; 176, integer:1; 177, attribute; 178, argument_list; 179, call; 180, dictionary; 181, pair; 182, attribute; 183, argument_list; 184, integer:1; 185, identifier:value; 186, identifier:strip; 187, string; 188, identifier:join; 189, subscript; 190, attribute; 191, argument_list; 192, pair; 193, pair; 194, call; 195, identifier:value; 196, subscript; 197, identifier:strip; 198, string_content:#; 199, identifier:vcomps; 200, slice; 201, subscript; 202, identifier:strip; 203, string; 204, identifier:value; 205, string; 206, identifier:comment; 207, attribute; 208, argument_list; 209, identifier:comps; 210, integer:0; 211, integer:1; 212, identifier:comps; 213, integer:0; 214, string_content:value; 215, string_content:comment; 216, subscript; 217, identifier:strip; 218, identifier:comps; 219, integer:0
code: def read_conf(conf_file, out_format='simple'):
      '''
      Read in an LXC configuration file. By default returns a simple, unsorted
      dict, but can also return a more detailed structure including blank lines
      and comments.
  
      out_format:
          set to 'simple' if you need the old and unsupported behavior.
          This won't support the multiple lxc values (eg: multiple network nics)
  
      CLI Examples:
  
      .. code-block:: bash
  
          salt 'minion' lxc.read_conf /etc/lxc/mycontainer.conf
          salt 'minion' lxc.read_conf /etc/lxc/mycontainer.conf out_format=commented
      '''
      ret_commented = []
      ret_simple = {}
      with salt.utils.files.fopen(conf_file, 'r') as fp_:
          for line in salt.utils.data.decode(fp_.readlines()):
              if '=' not in line:
                  ret_commented.append(line)
                  continue
              comps = line.split('=')
              value = '='.join(comps[1:]).strip()
              comment = None
              if value.strip().startswith('#'):
                  vcomps = value.strip().split('#')
                  value = vcomps[1].strip()
                  comment = '#'.join(vcomps[1:]).strip()
                  ret_commented.append({comps[0].strip(): {
                      'value': value,
                      'comment': comment,
                  }})
              else:
                  ret_commented.append({comps[0].strip(): value})
                  ret_simple[comps[0].strip()] = value
  
      if out_format == 'simple':
          return ret_simple
      return ret_commented