human
Complete this python program:
def MonkeyPatchThreadingLocal(_threading_local):
assistant
#Here is the Python program you requested.

    """Given a reference to the _threading_local module, fix _localbase.__new__.
    This ensures that using dev_appserver with a Python interpreter older than
    2.7 will include the fix to the _threading_local._localbase.__new__ method
    which was introduced in Python 2.7 (http://bugs.python.org/issue1522237).
    """
    @staticmethod
    def New(cls, *args, **kw):
        self = object.__new__(cls)
        key = ('_local__key', ('thread.local.' + str(id(self))))
        object.__setattr__(self, '_local__key', key)
        object.__setattr__(self, '_local__args', (args, kw))
        object.__setattr__(self, '_local__lock', _threading_local.RLock())
        if ((args or kw) and (cls.__init__ is object.__init__)):
            raise TypeError('Initialization    arguments    are    not    supported')
        dict = object.__getattribute__(self, '__dict__')
        _threading_local.current_thread().__dict__[key] = dict
        return self
    _threading_local._localbase.__new__ = New