ImaGen: Generic Python library for 0D, 1D and 2D pattern distributions