def patch(obj, attribute, value):
    patcher = MonkeyPatcher((obj, attribute, value))
    patcher.patch()
    return patcher.restore
Set 'obj.attribute' to 'value' and return a callable to restore 'obj'.
dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/external/testtools/monkey.py/patch