Create allpairs_example.py

A new more generic example for the All Pairs pattern.