def read(data=None):
    """
Read ``sinfo -o "%all"``.

:options:

  **data** (``<str>``)
    For debugging: specify the output of ``sinfo -o "%all"`` as string.

:returns:

  **lines** ``<list<dict>>``
    A list of dictionaries, that contain the different fields. All data are strings.
  """
    import subprocess
    if data is None:
        data = subprocess.check_output('sinfo -o "%all"', shell=True).decode(
            'utf-8')
    head, data = data.split('\n', 1)
    data = list(filter(None, data.split('\n')))
    head = head.split('|')
    lines = []
    for line in data:
        info = {}
        for key, val in zip(head, line.split('|')):
            if len(key.strip()) > 0:
                info[key.strip()] = val.strip()
        lines += [info]
    return lines
