def __init__(self, toks):

        self.attrs = {}
        i = 0
        
        while i < len(toks):
            attrname = toks[i]
            if i+2 < len(toks) and toks[i+1] == '=':
                attrvalue = toks[i+2]
                i += 3
            else:
                attrvalue = None
                i += 1
                
            self.attrs[attrname] = attrvalue
dataset/ETHPy150Open erocarrera/pydot/dot_parser.py/P_AttrList.__init__/original