@staticmethod
def _parse_keyvals(line_iter):
    """Generate dictionary from key/value pairs.
        """
    out = None
    line = None
    for line in line_iter:
        if len(line) == 1 and line[0].upper() == line[0]:
            break
        else:
            if out is None:
                while not line[-1]:
                    line = line[:-1]
                out = [{} for _ in line[1:]]
            while len(line) < len(out) + 1:
                line.append('')
            for i in range(len(out)):
                out[i][line[0]] = line[i + 1].strip()
            line = None
    return out, line
