Generation of polyominoes in python