def vim2vim(filename):
    """Transform output from `:highlight` to a flat, plain vim colorscheme.

    """
    with open(filename, 'r') as f:
        for line in f:
            log.debug(line.rstrip())
            l = line.strip()
            if not l or l not in 'xxx':
                continue
            name, attrs = l.split('xxx')
            name = name.strip()
            attrs = attrs.strip()
            attrdict = dict.fromkeys(ATTRS, None)
            attrdict['name'] = name

            if attrs.startswith('links to'):
                attrdict['link'] = attrs.split('links to ')[-1]
            elif attrs.startswith('cleared'):
                attrdict['cleared'] = True
            else:
                _attrs = [x.split('=',1) for x in attrs.split(' ')]
                try:
                    attrdict.update(_attrs)
                except ValueError:
                    log.error(_attrs)
                    raise

            yield ColorGroup(**attrdict)
dataset/ETHPy150Open westurner/vim2vim/vim2vim/vim2vim.py/vim2vim/swapped operands of `not in`