Set counter of ``name`` to ``num``.
185287
def set_to(cls, name, num):
        """"""
        if num < 0:
            raise CounterValueError('Counter[%s] can not be set to %s' % (
                                    name, num))
        else:
            counter = cls.collection.find_and_modify(
                {'name': name},
                {'$set': {'seq': num}},
                new=True,
                upsert=True
            )
            return counter['seq']
1371043
def _set_int(self, commands, name):
        
        if name in commands:
            try:
                value = int(commands[name])
                setattr(self, name, value)
            except ValueError:
                pass
1200402
def constant(self, name, value):
        """"""
        assert is_iterable_typed(name, basestring)
        assert is_iterable_typed(value, basestring)
        self.registry.current().add_constant(name[0], value)
90057
def do_counter_reset(self, element, decl, pseudo):
        """"""
        step = self.state[self.state['current_step']]
        counter_name = ''
        for term in decl.value:
            if type(term) is ast.WhitespaceToken:
                continue

            elif type(term) is ast.IdentToken:
                if counter_name:
                    step['counters'][counter_name] = 0
                counter_name = term.value

            elif type(term) is ast.LiteralToken:
                if counter_name:
                    step['counters'][counter_name] = 0
                    counter_name = ''

            elif type(term) is ast.NumberToken:
                if counter_name:
                    step['counters'][counter_name] = int(term.value)
                    counter_name = ''

            else:
                log(WARN, u"Unrecognized counter-reset term {}"
                    .format(type(term)).encode('utf-8'))
        if counter_name:
            step['counters'][counter_name] = 0
962425
def increment(self, counter_name, delta):
    
    current_value = self.counters.get(counter_name, 0)
    new_value = current_value + delta
    self.counters[counter_name] = new_value
    return new_value
1094468
def mark(self, value=1):
    """"""

    self['count'] += value
    for m in self._meters:
      m.update(value)
912274
def counter(self, name):
        
        with self._lock:
            if name not in self._counters:
                if self._registry._ignore_patterns and any(
                    pattern.match(name) for pattern in self._registry._ignore_patterns
                ):
                    counter = noop_metric
                else:
                    counter = Counter(name)
                self._counters[name] = counter
            return self._counters[name]
955168
public function incrementCounter($name, $value = 1) {
        if (!isset($this->counters[$name])) {
            $this->counters[$name] = 0;
        }
        $this->counters[$name] += $value;
    }
560429
def set_param(self, name: str, v) -> None:
        """"""
        self.params[zlib.crc32(name.encode())] = v
1306986
function(name, incr /* =1 */ ) {
			var currVal = this.getMetric(name) || 0;
			this.setMetric(name, currVal + (typeof incr === 'number' ? incr : 1));
		}
1012284
def __set_name(self, value):
        '''
        
        '''
        if not value or not len(value):
            raise ValueError("Invalid name.")

        self.__name = value
1267138
def FMErrorByNum( num ):
    """"""

    if not num in FMErrorNum.keys():
        raise FMServerError, (num, FMErrorNum[-1])
    elif num == 102:
        raise FMFieldError, (num, FMErrorNum[num])
    else:
        raise FMServerError, (num, FMErrorNum[num])
289684
def _set_name(self, version=AUTO):
        """"""

        name = 'python'

        if version:
            if version is AUTO:
                version = sys.version_info[0]

                if version == 2:
                    version = ''

            name = '%s%s' % (name, version)

        self.name = name
1040641
public void increment(String name, int value) {
		Counter counter = get(name, CounterType.Increment);
		counter.setCount(counter.getCount() != null ? counter.getCount() + value : value);
		update();
	}
842064
def _n(name):
    """"""
    n = name.encode('ascii', errors='ignore').decode('ascii')
    n = re.sub('[^A-Za-z0-9_]', '_', n)
    n = re.sub(r'(^[0-9].*)', r'p\1', n)
    return n
1081914
def timestamp(self, name, value):
        
        for counter in self._counters:
            counter.timestamp(name, value)
815017
def _ensure_counter(self):
        """"""
        if self._counter_path not in self._client.kv:
            self._client.kv[self._counter_path] = ''.zfill(self._COUNTER_FILL)