How to pass variable to mongo pipeline from python

Please see the following thread.