Should only be called once
963110
function(pageLinks) {
			this._categorizedPageLinks = {};
			pageLinks.getAllLinks().forEach(function(link) {
				var category = link.category;
				this._categorizedPageLinks[category] = this._categorizedPageLinks[category] || [];
				this._categorizedPageLinks[category].push({
					title: link.textContent,
					order: link.order || 100,
					href: link.href
				});
			}, this);
		}
7944
def _loop_once(self, timeout=None):
        
        _vv and IOLOG.debug('%r._loop_once(%r, %r)',
                            self, timeout, self.poller)
        #IOLOG.debug('readers =\n%s', pformat(self.poller.readers))
        #IOLOG.debug('writers =\n%s', pformat(self.poller.writers))
        for side, func in self.poller.poll(timeout):
            self._call(side.stream, func)
462228
public void start()
    {
        Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Cannot be started more than once");

        service.submit
            (
                new Callable<Object>()
                {
                    @Override
                    public Object call() throws Exception
                    {
                        processEvents();
                        return null;
                    }
                }
            );
    }
902398
function once(event, listener) {
  function g() {
    this.removeListener(event, g);
    listener.apply(this, arguments);
  };
  this.on(event, g);
  return this;
}
943884
def call_once(self, request=None, *args, **kwargs):
        
        if request is not None:
            self.request = request

        config = self.request.configuration
        if config.http_method != EBConsts.HTTP_METHOD_POST or config.method != EBConsts.METHOD_REST:
            raise Error('Not implemented yet, only REST POST method is allowed')

        url = self.request.url if self.request.url is not None else self.build_url()
        logger.debug("URL to call: %s", url)

        # Do the request
        resp = requests.post(url, json=self.request.body, timeout=config.timeout, headers=self.request.headers)
        self.last_resp = resp
        return self.check_response(resp)
1032503
public function wasCalledAtLeastOnce(): bool
    {
        if (count($this->invocations) < 1) {
            throw new CallAmountViolation(sprintf(
                    '%s was expected to be called at least once,'
                    . ' but was never called.',
                    $this->invocations->name()
            ));
        }

        return true;
    }
466666
public function once($event, $callback, $first = false)
	{
		$this->register($event, $callback, $first, true);
	}
370788
def execute_once(self, string):
        """"""
        for rule in self.rules:
            if rule[0] in string:
                pos = string.find(rule[0])
                self.last_rule = rule
                return string[:pos] + rule[1] + string[pos+len(rule[0]):]
        self.last_rule = None
        return string
792415
def meth_once(f):
  ""
  attr = '__meth_once_'+f.__name__
  @functools.wraps(f)
  def f2(self,*args,**kwargs):
    if hasattr(self,attr): raise CallOnceError(f.__name__)
    setattr(self,attr,True)
    return f(self,*args,**kwargs)
  return f2
21382
def call_only_once(func):
    
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        self = args[0]
        # cannot use hasattr here, because hasattr tries to getattr, which
        # fails if func is a property
        assert func.__name__ in dir(self), "call_only_once can only be used on method or property!"

        if not hasattr(self, '_CALL_ONLY_ONCE_CACHE'):
            cache = self._CALL_ONLY_ONCE_CACHE = set()
        else:
            cache = self._CALL_ONLY_ONCE_CACHE

        cls = type(self)
        # cannot use ismethod(), because decorated method becomes a function
        is_method = inspect.isfunction(getattr(cls, func.__name__))
        assert func not in cache, \
            "{} {}.{} can only be called once per object!".format(
                'Method' if is_method else 'Property',
                cls.__name__, func.__name__)
        cache.add(func)

        return func(*args, **kwargs)

    return wrapper
899713
public function once($event, callable $listener)
    {
        parent::once($event, $listener);
        $this->stderr->once($event, $listener);
    }
1323451
def once(plugin, parent_stack=None):
    ''''''
    plugin.clear_added_items()
    items = plugin.run()

    # if update_listing=True, we need to remove the last url from the parent
    # stack
    if parent_stack and plugin._update_listing:
        del parent_stack[-1]

    # if we have parent items, include the most recent in the display
    if parent_stack:
        items.insert(0, parent_stack[-1])

    display_listitems(items, plugin.request.url)
    return items
492968
def append_once(cls, code, **kwargs):
        
        if kwargs:
            g = cls.with_id_processor()
            g._append_context(kwargs)
        else:
            g = cls()
        g.append(code)
        return g.code
969881
def repeat_call(func, retries, *args, **kwargs):
    '''
    
    '''
    retries = max(0, int(retries))
    try_num = 0
    while True:
        if try_num == retries:
            return func(*args, **kwargs)
        else:
            try:
                return func(*args, **kwargs)
            except Exception as e:
                if isinstance(e, KeyboardInterrupt):
                    raise e
                try_num += 1
656436
def run_once_on_threshold(callback, mv_lower, mv_upper, mv_reset=10, interval=0.01)
      AIN::run_once_on_threshold(callback, @pin, mv_lower, mv_upper, mv_reset, interval)
    end
560842
function on(eventName, handler, context, args, once) {
    this.__listeners = this.__listeners || {};
    this.__listeners[eventName] = this.__listeners[eventName] || [];
    this.__listeners[eventName].push({
        fn: handler,
        context: context,
        args: args,
        once: !!once
    });
}
614057
def log_once(log_func, msg, *args, **kwargs):
  """""""
  if msg not in _LOG_ONCE_SEEN:
    log_func(msg, *args, **kwargs)
    # Key on the message, ignoring args. This should fit most use cases.
    _LOG_ONCE_SEEN.add(msg)