def METHOD_NAME():
    # type: () -> None
    from django.core.handlers import base
    old_import_string = getattr(base, import_string_name)
    def sentry_patched_import_string(dotted_path):
        # type: (str) -> Any
        rv = old_import_string(dotted_path)
        if _import_string_should_wrap_middleware.get(None):
            rv = _wrap_middleware(rv, dotted_path)
        return rv
    setattr(base, import_string_name, sentry_patched_import_string)
    old_load_middleware = base.BaseHandler.load_middleware
    def sentry_patched_load_middleware(*args, **kwargs):
        # type: (Any, Any) -> Any
        _import_string_should_wrap_middleware.set(True)
        try:
            return old_load_middleware(*args, **kwargs)
        finally:
            _import_string_should_wrap_middleware.set(False)
    base.BaseHandler.load_middleware = sentry_patched_load_middleware