docs: def batch_watch(parameterized, run=True):
      """
      Context manager to batch watcher events on a parameterized object.
      The context manager will queue any events triggered by setting a
      parameter on the supplied parameterized object and dispatch them
      all at once when the context manager exits. If run=False the
      queued events are not dispatched and should be processed manually.
      """
      BATCH_WATCH = parameterized.param._BATCH_WATCH
      parameterized.param._BATCH_WATCH = True
      try:
          yield
      finally:
          parameterized.param._BATCH_WATCH = BATCH_WATCH
          if run and not BATCH_WATCH:
              parameterized.param._batch_call_watchers()