def getPixelAttrRandom(self, x, y):
        'weighted-random choice of attr at this pixel.'
        c = list(attr for attr, rows in self.pixels[y][x].items()
                         for r in rows if attr and attr not in self.hiddenAttrs)
        return random.choice(c) if c else 0
def getPixelAttrRandom ( self , x , y ) : c = list ( attr for attr , rows in self . pixels [ y ] [ x ] . items ( ) for r in rows if attr and attr not in self . hiddenAttrs ) return random . choice ( c ) if c else 0
weighted-random choice of attr at this pixel.