Pattern In Python Logic Module