I am in search for the right approach to monkey patch any function in a python module from within my app without modifying the modules package itself.
The background of my question is that my app is using Elasticsearch 2. ES 2 does not accept indexing of documents where fieldnames contain periods. Since my app uses pyes in multiple locations, I'd like to globally patch the indexing method and make sure that any period characters will be turned to underscore characters.