def patch(self):
        """
        Apply all of the patches that have been specified with L{addPatch}.
        Reverse this operation using L{restore}.
        """
        for obj, name, value in self._patchesToApply:
            if not self._alreadyPatched(obj, name):
                self._originals.append((obj, name, getattr(obj, name)))
            setattr(obj, name, value)

        Apply all of the patches that have been specified with L{addPatch}.
        Reverse this operation using L{restore}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/monkey.py