code: def do_watch(self, params):
          
          wm = get_watch_manager(self._zk)
          if params.command == "start":
              debug = to_bool(params.debug)
              children = to_int(params.sleep, -1)
              wm.add(params.path, debug, children)
          elif params.command == "stop":
              wm.remove(params.path)
          elif params.command == "stats":
              repeat = to_int(params.debug, 1)
              sleep = to_int(params.sleep, 1)
              if repeat == 0:
                  while True:
                      wm.stats(params.path)
                      time.sleep(sleep)
              else:
                  for _ in range(0, repeat):
                      wm.stats(params.path)
                      time.sleep(sleep)
          else:
              self.show_output("watch <start|stop|stats> <path> [verbose]")
docs: \x1b[1mNAME\x1b[0m
          watch - Recursively watch for all changes under a path.
  
  \x1b[1mSYNOPSIS\x1b[0m
          watch <start|stop|stats> <path> [options]
  
  \x1b[1mDESCRIPTION\x1b[0m
          watch start <path> [debug] [depth]
  
          with debug=true, print watches as they fire. depth is
          the level for recursively setting watches:
  
            *  -1:  recurse all the way
            *   0:  don't recurse, only watch the given path
            * > 0:  recurse up to <level> children
  
          watch stats <path> [repeat] [sleep]
  
          with repeat=0 this command will loop until interrupted. sleep sets
          the pause duration in between each iteration.
  
          watch stop <path>
  
  \x1b[1mEXAMPLES\x1b[0m
          > watch start /foo/bar
          > watch stop /foo/bar
          > watch stats /foo/bar