Increments the counter for a model.
 @param [Object] obj The model instance for whom counter would be
   incremented
19447
def increment_for(obj)
      # decide the time of event asap
      ts = Time.now.ceil.to_i

      if obj.class.ancestors.include?Cequel::Record
        args = obj.key_attributes.collect { |k,v|  v.to_s }
        cache_key = generate_key(ts, obj.class.name, *args)

        val = Cequel::Record.redis.get(cache_key)
        if val.nil?
          val = 1
        else
          val = val.to_i + 1
        end

        ttl = (time_window + 1) * 60

        # Update a sharded counter
        Cequel::Record.redis.setex(cache_key, ttl, val)

        # Optionally, update the index
        index_key = generate_index_key(ts, obj.class.name, *args)
        index_present = Cequel::Record.redis.get(index_key).try(:to_i)
        if index_present != 1
          Cequel::Record.redis.setex(index_key, ttl, 1)
        end
      end

    end
156866
def increment_object_counter(node_uri, epoch_field, dry_run=False):
    
    current_count = read_object_counter(node_uri, epoch_field, dry_run=dry_run)

    if current_count is None:
        new_count = "01"
    else:
        new_count = coding.base36encode(coding.base36decode(current_count) + 1,
                                        pad_length=2)

    set_property(node_uri,
                 build_counter_tag(epoch_field, dry_run=dry_run),
                 new_count,
                 ossos_base=True)

    return new_count
822425
def increment(self, key, amount=1):
        
        payload = {
            key: {
                '__op': 'Increment',
                'amount': amount
                }
            }
        self.__class__.PUT(self._absolute_url, **payload)
        self.__dict__[key] += amount
953057
def update_counter(self, bucket, key, value, w=None, dw=None, pw=None,
                       returnvalue=False):
        
        raise NotImplementedError
1364922
public int getCount(T obj) {
        int objIndex = (allowNewIndices) 
            ? objectIndices.index(obj)
            : objectIndices.find(obj);
        return (objIndex < 0) ? 0 : indexToCount.get(objIndex);
    }
1293193
def update(self, obj):
        ''''''
        self._dict.update(obj)
        for k, v in obj.items():
            # if k.isupper():
            #    self._check_readonly(k, v)
            if env.verbosity > 2:
                self._log(k, v)
348232
public int add(T obj) {
        int ordinal = get(obj);
        if(ordinal != -1)
            return ordinal;
        
        if(size == objectsByOrdinal.length)
            growCapacity();
        
        objectsByOrdinal[size] = obj;
        hashOrdinalIntoArray(size, hashedOrdinalArray);
        
        return size++;
    }
1159398
function(obj) {
      if (obj == null) return void 0;
      return this._byId[obj] ||
        this._byId[this.modelId(obj.attributes || obj)] ||
        obj.cid && this._byId[obj.cid];
    }
483245
def <<(obj)
      if obj.is_a?(Integer)
        push_int(obj)
      elsif obj.is_a?(String)
        append_data(obj)
      elsif obj.is_a?(Array)
        obj.each { |o| self.<< o}
        self
      end
    end
918057
def incrementSub(self, amount=1):
        
        self._subProgressBar.setValue(self.subValue() + amount)
        QApplication.instance().processEvents()
610941
def increment(self, key: Any, by: int = 1) -> None:
        
        if key is not None:
            self[key] = self.get(key, 0) + by
981541
def add_object(self, obj):
        

        # delegate to SchemaType object
        schema_generator = self._get_generator_for_object(obj)
        schema_generator.add_object(obj)

        # return self for easy method chaining
        return self
211523
def increment(method):
        
        if not hasattr(method, '__context'):
            raise ContextException("Method does not have context!")
        ctxt = getattr(method, '__context')
        ctxt.enter()
        return ctxt
343993
function incrementCacheCount (cacheCount, hash) {
  cacheCount[hash] = cacheCount[hash] === undefined ? 1 : cacheCount[hash] + 1;
}
460704
def increment(handler, increment, item_id, counter_name):
    """"""
    data = {'operation': 'increment_counter',
            'id': item_id,
            'counter_name': counter_name,
            'increment': increment}
    handler.invoke(data)
617315
private function incrementLikeCount()
	{
		$counter = $this->likeCounter()->first();
		
		if($counter) {
			$counter->count++;
			$counter->save();
		} else {
			$counter = new LikeCounter;
			$counter->count = 1;
			$this->likeCounter()->save($counter);
		}
	}
886231
def increment(self, name, value):
        
        for counter in self._counters:
            counter.increment(name, value)