This method search for the zero-crossing of the watched parameter

        Args:
            begin (Orbit):
            end (Orbit)
            listener (Listener)
        Return
            Return
184147
def _bisect(self, begin, end, listener):
        

        step = (end.date - begin.date) / 2

        while abs(step) >= self._eps_bisect:
            date = begin.date + step
            if self.SPEAKER_MODE == "global":
                orb = self.propagate(date)
            else:
                orb = begin.propagate(date)
            if listener(begin) * listener(orb) > 0:
                begin = orb
            else:
                end = orb
            step = (end.date - begin.date) / 2
        else:
            end.event = listener.info(end)
            return end
750586
def unwatch(value):
    """"""
    if not isinstance(value, Watchable):
        raise TypeError("Expected a Watchable, not %r." % value)
    spectator = watcher(value)
    try:
        del value._instance_spectator
    except Exception:
        pass
    return spectator
1157068
def dont_watch_buffer(self, bw, *argv, **argd):
        

        # The sane way to do it.
        if not (argv or argd):
            self.__clear_buffer_watch(bw)

        # Backwards compatibility with WinAppDbg 1.4.
        else:
            argv = list(argv)
            argv.insert(0, bw)
            if 'pid' in argd:
                argv.insert(0, argd.pop('pid'))
            if 'address' in argd:
                argv.insert(1, argd.pop('address'))
            if 'size' in argd:
                argv.insert(2, argd.pop('size'))
            if argd:
                raise TypeError("Wrong arguments for dont_watch_buffer()")
            try:
                pid, address, size = argv
            except ValueError:
                raise TypeError("Wrong arguments for dont_watch_buffer()")
            self.__clear_buffer_watch_old_method(pid, address, size)
932070
def watch(watch_value, &block)
      new_thread = Thread.new do
        prev_value = (self.read == GPIO_HIGH ? GPIO_LOW : GPIO_HIGH)

        loop do
          current_value = self.read
          flip = (prev_value != current_value)

          if current_value == watch_value && flip
            self.instance_exec &block
          end

          prev_value = current_value

          sleep WATCH_POLLING_SEC
        end
      end

      new_thread.abort_on_exception = true
      new_thread
    end
753204
function tryWatch(target, callback) {
  if (!target) {
    return logger.halt('invalid watch target')
  }
  if (!callback || typeof callback !== 'function') {
    return logger.halt('invalid watch callback')
  }

  return fs.watch(
    target, { persistent: true, recursive: true},
    function (e, file) {
      // todo: exact watch
      callback(e, file)
    }
  )
}
193244
def get(self, path, watch=None):
        
        return self._zk.get(self.__path(path), watch=watch)
790133
function notifyWatchersOnPaths(paths) {
    var expandedPaths = _expandNestedPaths(paths);

    watchers.map(function _notifyWatcher(watcher) {
      var hasPath = intersect(expandedPaths, watcher.paths).length > 0;

      if (hasPath) {
        var watchedKeyValues = {};
        try {
          watchedKeyValues = getAll(paths);
        } catch (e) {}

        if (watcher.options.async !== false) {
          setTimeout(function () {
            watcher.callback(watchedKeyValues);
          }, watcher.options.async || 0);
        } else {
          watcher.callback(watchedKeyValues);
        }
      }
    });

    if (paths !== '*') {
      notifyGlobalWatchers();
    }
  }
1135380
public void startWatching() {
        try {
            final List<MonitorLine> lines = getSource().getLastLine(getInitialCount());
            actual = null;
            updateLines(lines);
        } catch (Exception e) {
            notifyObservers(e);
        }
    }
432068
def stop_watching(self):
        
        self._watch = False

        if self._observer:
            self._logger.info('Stopping watcher')
            self._observer.stop()
            self._logger.info('Watcher stopped')
1153164
def xfrange(stop, start=None, step=1.0):
    
    if not step:
        raise ValueError('step must be non-zero')
    if start is None:
        start, stop = 0.0, stop * 1.0
    else:
        # swap when all args are used
        stop, start = start * 1.0, stop * 1.0
    cur = start
    while cur < stop:
        yield cur
        cur += step
437704
@Override
	public void onStopwatchStop(Split split, StopwatchSample sample) {
		getStopwatchLogTemplate(split.getStopwatch()).log(split, stopwatchLogMessageSource);
	}
69621
public static void main(String[] args) {
		SimonManager.callback().addCallback(new CallbackSkeleton() {
			@Override
			public void onStopwatchStart(Split split) {
				System.out.println("\nStopwatch " + split.getStopwatch().getName() + " has just been started.");
			}

			@Override
			public void onStopwatchStop(Split split, StopwatchSample sample) {
				System.out.println("Stopwatch " + split.getStopwatch().getName()
					+ " has just been stopped (" + SimonUtils.presentNanoTime(split.runningFor()) + ").");
			}
		});

		Stopwatch sw = SimonManager.getStopwatch(SimonUtils.generateName());
		sw.start().stop();

		Split split = sw.start();
		//noinspection StatementWithEmptyBody
		for (int i = 0; i < 1000000; i++) {
			// what does JVM do with empty loop? :-)))
		}
		split.stop();

		sw.start().stop();

		System.out.println("\nAdditional stop() does nothing, Split state is preserved.");
		split.stop();
		System.out.println("split = " + split);
	}
59766
def _watch(self):
        
        async def _all_watcher():
            try:
                allwatcher = client.AllWatcherFacade.from_connection(
                    self.connection())
                while not self._watch_stopping.is_set():
                    try:
                        results = await utils.run_with_interrupt(
                            allwatcher.Next(),
                            self._watch_stopping,
                            loop=self._connector.loop)
                    except JujuAPIError as e:
                        if 'watcher was stopped' not in str(e):
                            raise
                        if self._watch_stopping.is_set():
                            # this shouldn't ever actually happen, because
                            # the event should trigger before the controller
                            # has a chance to tell us the watcher is stopped
                            # but handle it gracefully, just in case
                            break
                        # controller stopped our watcher for some reason
                        # but we're not actually stopping, so just restart it
                        log.warning(
                            'Watcher: watcher stopped, restarting')
                        del allwatcher.Id
                        continue
                    except websockets.ConnectionClosed:
                        monitor = self.connection().monitor
                        if monitor.status == monitor.ERROR:
                            # closed unexpectedly, try to reopen
                            log.warning(
                                'Watcher: connection closed, reopening')
                            await self.connection().reconnect()
                            if monitor.status != monitor.CONNECTED:
                                # reconnect failed; abort and shutdown
                                log.error('Watcher: automatic reconnect '
                                          'failed; stopping watcher')
                                break
                            del allwatcher.Id
                            continue
                        else:
                            # closed on request, go ahead and shutdown
                            break
                    if self._watch_stopping.is_set():
                        try:
                            await allwatcher.Stop()
                        except websockets.ConnectionClosed:
                            pass  # can't stop on a closed conn
                        break
                    for delta in results.deltas:
                        try:
                            delta = get_entity_delta(delta)
                            old_obj, new_obj = self.state.apply_delta(delta)
                            await self._notify_observers(delta, old_obj, new_obj)
                        except KeyError as e:
                            log.debug("unknown delta type: %s", e.args[0])
                    self._watch_received.set()
            except CancelledError:
                pass
            except Exception:
                log.exception('Error in watcher')
                raise
            finally:
                self._watch_stopped.set()

        log.debug('Starting watcher task')
        self._watch_received.clear()
        self._watch_stopping.clear()
        self._watch_stopped.clear()
        self._connector.loop.create_task(_all_watcher())
978628
def cmd_watch(args):
    ''''''
    if len(args) == 0:
        mpstate.status.watch = None
        return
    mpstate.status.watch = args
    print("Watching %s" % mpstate.status.watch)
850429
def zero_crossing_before(self, n):
        """"""
        n_in_samples = int(n * self.samplerate)

        search_start = n_in_samples - self.samplerate
        if search_start < 0:
            search_start = 0

        frame = zero_crossing_last(
            self.range_as_mono(search_start, n_in_samples)) + search_start

        return frame / float(self.samplerate)
13149
function startTimer(req, res, next) {
  req.mainRoutePath = req.route.path;
  req.stopTimer = eyes.start('routes.' + req.mainRoutePath + '.' + req.method);
  next();
}
1145923
static int findZero( byte[] data , int index , int end ) {
		while( index < end && data[index] != 0 ) {
			index++;
		}
		return index;
	}