Identical to enqueue_at but takes number_of_seconds_from_now
 instead of a timestamp.
17667
def enqueue_in(number_of_seconds_from_now, klass, *args)
      enqueue_at(Time.now + number_of_seconds_from_now, klass, *args)
    end
410884
def timestamp(self, name, value):
        
        counter = self.get(name, CounterType.Timestamp)
        counter.time = value if value != None else datetime.datetime.utcnow()
        self._update()
493865
def at_time(self, time, nearest_sample=False):
        
        if nearest_sample:
            time += self.delta_t / 2.0
        return self[int((time-self.start_time)*self.sample_rate)]
156003
function enqueue(queue, update) {
  if (update) {
    queue = queue || [];
    queue.push(update);
  }
  return queue;
}
169467
def plugin_wait_time(seconds: float, item_session: ItemSession, error: Optional[Exception]=None) -> float:
        '''
        '''
        return seconds
1002006
def aggregate!(ts = Time.now.floor)
      aggregate_and_create(Octo::Counter::TYPE_MINUTE, ts)
    end
941560
function( time, type ) {
		time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
		type = type || "fx";

		return this.queue( type, function() {
			var elem = this;
			setTimeout(function() {
				jQuery.dequeue( elem, type );
			}, time );
		});
	}
466161
function() {
			var iLastTimeStamp = -1,
				iLastTimeoutId = -1,
				iWaitTimeout = 1000,
				sCurrentKeyPrefix = "",
				fnTimedKeydown = function(iTimeStamp, iKeyCode) {
					var aMatchingItems;
					//the previous call was more than a second ago or this is the first call
					if (iLastTimeStamp + iWaitTimeout < iTimeStamp) {
						sCurrentKeyPrefix = "";
					} else {
						if (iLastTimeoutId !== -1) {
							clearTimeout(iLastTimeoutId);
							iLastTimeoutId = -1;
						}
					}

					sCurrentKeyPrefix += String.fromCharCode(iKeyCode).toLowerCase();

					aMatchingItems = this._getVisibleItems().filter(function(item) {
						return item.getKey().indexOf(sCurrentKeyPrefix) === 0; //starts with the current prefix
					});

					if (aMatchingItems.length > 1) {
						iLastTimeoutId = setTimeout(function() {
							this.setSelectedValue(sCurrentKeyPrefix);
							sCurrentKeyPrefix = "";
							iLastTimeoutId = -1;
						}.bind(this), iWaitTimeout);
					} else if (aMatchingItems.length === 1) {
						this.setSelectedValue(aMatchingItems[0].getKey());
						sCurrentKeyPrefix = "";
					} else {
						sCurrentKeyPrefix = "";
					}

					iLastTimeStamp = iTimeStamp;
				};

			return fnTimedKeydown;
		}
769796
def now(self, when=None):
        
        if when is None:
            when = _TaskManager().get_time()
        tup = time.localtime(when)

        self.value = (tup[0]-1900, tup[1], tup[2], tup[6] + 1)

        return self
118377
function() {
      var t = this,
          now = Date.now();

      // This kicks off the send
      t.lastSendTime = now;
      t.set({
        bundle: t.queue,
        sequence: t.get('sequence') + 1
      });

      // Reset
      t.queue = [];
      if (t.timer) {
        clearTimeout(t.timer);
        t.timer = null;
      }
    }
1189500
def timestamps!
      [:created_at, :updated_at].each do |name|
        _add_key(name)
        attr_reader name
        class_eval(<<-RUBY, __FILE__, __LINE__)
          def #{name}=(value)                       # def created_at=(value)
            if value.kind_of?(String)               #   if value.kind_of?(String)
              value = Time.cast_from_string(value)  #     value = Time.cast_from_string(value)
            end                                     #   end
            @#{name} = value.nil? ? nil : value.utc #   @created_at = value.nil? ? nil : value.utc
          end                                       # end
        RUBY
      end

      class_eval(<<-RUBY, __FILE__, __LINE__)
        def _save(safe)
          if new_record?
            self.created_at = self.updated_at = Time.now
          else
            original_updated_at = updated_at
            self.updated_at = Time.now
          end
          super
        rescue Mongo::MongoDBError => e
          if new_record?
            self.created_at = self.updated_at = nil
          else
            self.updated_at = original_updated_at
          end
          raise e
        end

        def _update(selector, data, safe)
          original_updated_at = updated_at
          self.updated_at = Time.now
          data[:updated_at] = updated_at
          super
        rescue Mongo::MongoDBError => e
          self.updated_at = original_updated_at
          raise e
        end
      RUBY
    end
290543
def strtime(at=None, fmt=PERFECT_TIME_FORMAT):
    """"""
    if not at:
        at = utcnow()
    return at.strftime(fmt)
1292016
def put_nowait(self, item: _T) -> None:
        
        self._consume_expired()
        if self._getters:
            assert self.empty(), "queue non-empty, why are getters waiting?"
            getter = self._getters.popleft()
            self.__put_internal(item)
            future_set_result_unless_cancelled(getter, self._get())
        elif self.full():
            raise QueueFull
        else:
            self.__put_internal(item)
796007
function  (fn, context, rate, warningThreshold) {

        var queue = [],
            timeout;

        function next () {

            if (queue.length === 0) {
                timeout = null;
                return;
            }

            fn.apply(context, queue.shift());

            timeout = setTimeout(next, rate);
        }

        return function () {

            if (!timeout) {
                timeout = setTimeout(next, rate);
                fn.apply(context, arguments);
                return;
            }

            queue.push(arguments);

            if (queue.length * rate > warningThreshold) {
                console.warn("[WARNING] Rate limited function call will be delayed by", ((queue.length * rate) / 1000).toFixed(3), "secs");
            }
        };
    }
525572
def wait_for(self, text, seconds):
        
        found = False
        stream = self.stream
        start_time = time.time()
        while not found:
            if time.time() - start_time > seconds:
                break
            stream.data_available.wait(0.5)
            stream.data_unoccupied.clear()
            while stream.data:
                line = stream.data.pop(0)
                value = line.getvalue()
                if text in value:
                    found = True
                self.lines.append(value)
                stream.data_available.clear()
                stream.data_unoccupied.set()
                if time.time() - start_time > seconds:
                    break
        return found
854394
def timing(name, delta, rate=1, tags=None):
    
    return client().timing(name, delta, rate=rate, tags=tags)
539824
def at!(ts = nil, time: nil, version: nil)
      Deprecations.show_ts_deprecation_for("#at!") if ts

      return at_version!(version) if version

      time ||= ts
      time = parse_time(time)

      return self if log_data.current_ts?(time)
      return false unless log_data.exists_ts?(time)

      version = log_data.find_by_time(time).version

      apply_diff(version, log_data.changes_to(version: version))
    end