docstr: Parse the configuration file and yield pairs of
  (name, contents) for each node.
docstr_tok: ["Parse","the","configuration","file","and","yield","pairs","of","(","name",",","contents",")","for","each","node","."]
code: def parse_cfgfile(self, filename):
      """Parse the configuration file and yield pairs of
      (name, contents) for each node.
      """
      with open(filename, "r") as f:
          for line in f:
              line = line.strip()
              if not line or line.startswith("#"):
                  continue
              colon_i = line.find(":")
              lbracket_i = line.find("[")
              rbracket_i = line.find("]")
              if (
                  colon_i < 1
                  or lbracket_i <= colon_i
                  or rbracket_i <= lbracket_i
              ):
                  raise RuntimeError(
                      "Invalid line in %s:\n%s\n" % (filename, line)
                  )
  
              name = line[:colon_i]
              val = line[lbracket_i + 1 : rbracket_i]
              vallist = (
                  [v.strip() for v in val.split(",")] if val else []
              )
              yield name, vallist
  
file_path: catboost/contrib/python/pycparser/py2/pycparser/_ast_gen.py
imports: from string import Template
label_desc: Use image node_id 3 for calling the ASTCodeGenerator obj's underlying member method code with example usage: obj.parse_cfgfile(filename) without return types