docs: def _make_middleware_stack(middleware, base):
          """
          Given a list of in-order middleware callables `middleware`
          and a base function `base`, chains them together so each middleware is
          fed the function below, and returns the top level ready to call.
          """
          for ware in reversed(middleware):
              base = ware(base)
          return base