code: def _fields_from_table(spec_table, id_key):
      
      # Reformat the table, throwing away lines not starting with '|'
      spec_lines = [line[1:-1].rstrip() for line in spec_table.splitlines()
                    if line.startswith('|')]
  
      # Guess the CSV dialect and read the table, producing an iterable
      dialect = csv.Sniffer().sniff(spec_lines[0], delimiters='|')
      reader = csv.DictReader(spec_lines, dialect=dialect)
  
      # Read the fields as dictionaries and transform keys and values to
      # lowercase.
      fields = []
      for row in reader:
          new_row = {}
          if row[id_key].strip():
              # Start of a new field, indicated by a nontrivial ID entry
              for key, val in row.items():
                  new_row[key.strip()] = val.strip()
              fields.append(new_row)
          else:
              # We have the second row of a multi-line field. We
              # append all stripped values to the corresponding existing entry
              # value with an extra space.
  
              if not fields:
                  # Just to make sure that this situation did not happen at
                  # the very beginning of the table
                  continue
  
              for key, val in row.items():
                  fields[-1][key.strip()] += (' ' + val).rstrip()
  
      return tuple(fields)
docs: Read a specification and return a list of fields.
  
      The given specification is assumed to be in
      `reST grid table format
      <http://docutils.sourceforge.net/docs/user/rst/quickref.html#tables>`_.
  
      Parameters
      ----------
      spec_table : str
          Specification given as a string containing a definition table.
      id_key : str
          Dictionary key (= column header) for the ID labels in ``spec``.
  
      Returns
      -------
      fields : tuple of dicts
          Field list of the specification with combined multi-line entries.
          Each field corresponds to one (multi-)line of the spec.