Python Itertools Product Function Engineering