Increments and returns current Adunit counter
@param {string} adunit id
@returns {number} current adunit count
8406
function incrementCounter(adunit) {
  adUnits[adunit] = adUnits[adunit] || {};
  adUnits[adunit].counter = (deepAccess(adUnits, `${adunit}.counter`) + 1) || 1;
  return adUnits[adunit].counter;
}
1171053
public function renderAdUnit($id)
    {
        $add = isset($this->_slots[$id]) ? $this->_slots[$id] : null ;
        if ($add) {
            return "
                <!-- " . $add['unitName'] . " -->
                <div id='" . $add['divId'] . "' style='width:" . $add['width'] . "px; height:" . $add['height'] . "px;'>
                <script type='text/javascript'>
                googletag.cmd.push(function() { googletag.display('" . $add['divId'] . "'); });
                </script>
                </div>";
        }

        return;
    }
65863
private long incrementTerm() {
    counters.compute(clusterMembershipService.getLocalMember().id(), (id, value) -> value != null ? value + 1 : 1);
    broadcastCounters();
    return currentTerm();
  }
227632
private static void buildAndDisplayAdUnitTree(AdUnit root, List<AdUnit> adUnits) {
    Map<String, List<AdUnit>> treeMap = new HashMap<String, List<AdUnit>>();

    for (AdUnit adUnit : adUnits) {
      if (adUnit.getParentId() != null) {
        if (treeMap.get(adUnit.getParentId()) == null) {
          treeMap.put(adUnit.getParentId(), new ArrayList<AdUnit>());
        }

        treeMap.get(adUnit.getParentId()).add(adUnit);
      }
    }

    if (root != null) {
      displayInventoryTree(root, treeMap);
    } else {
      System.out.println("No root unit found.");
    }
  }
965359
function updateSqliteStats(){
	if (count_writes % 100 !== 0)
		return;
	db.query("SELECT MAX(rowid) AS count_units FROM units", function(rows){
		var count_units = rows[0].count_units;
		if (count_units > 500000) // the db is too big, anaylze will lock db for long time,skip it from now on.
			return;
		readCountOfAnalyzedUnits(function(count_analyzed_units){
			console.log('count analyzed units: '+count_analyzed_units);
			if (count_units < 2*count_analyzed_units)
				return;
			count_units_in_prev_analyze = count_units;
			console.log("will update sqlite stats");
			db.query("ANALYZE", function(){
				db.query("ANALYZE sqlite_master", function(){
					console.log("sqlite stats updated");
				});
			});
		});
	});
}
683978
@VisibleForTesting
    public ClockAndCount getClockAndCountOf(ByteBuffer context, CounterId id)
    {
        int position = findPositionOf(context, id);
        if (position == -1)
            return ClockAndCount.BLANK;

        long clock = context.getLong(position + CounterId.LENGTH);
        long count = context.getLong(position + CounterId.LENGTH + CLOCK_LENGTH);
        return ClockAndCount.create(clock, count);
    }
1130184
function() {
      var UITinymceService = function() {
   	    var ID_ATTR = 'ui-tinymce';
    	// uniqueId keeps track of the latest assigned ID
    	var uniqueId = 0;
        // getUniqueId returns a unique ID
    	var getUniqueId = function() {
          uniqueId ++;
          return ID_ATTR + '-' + uniqueId;
        };
        // return the function as a public method of the service
        return {
        	getUniqueId: getUniqueId
        };
      };
      // return a new instance of the service
      return new UITinymceService();
    }
62331
function getNextId() {
    var dataIds = Object.keys(idIndexData)

    dataIds.sort(function (a, b) {
      return b - a
    })

    if (dataIds && dataIds[0]) {
      var id = _.parseInt(dataIds[0]) + 1
      return id
    } else {
      return 1
    }
  }
438177
function getAppendId(sHash){
			var iIndex = jQuery.inArray(currentHash, hashHistory),
				i, sHistory;
			if (iIndex > -1) {
				for (i = 0 ; i < iIndex + 1 ; i++) {
					sHistory = hashHistory[i];
					if (sHistory.slice(0, sHistory.length - 2) === sHash) {
						return uid();
					}
				}
			}

			return "";
		}
846310
def _counter(self):
        """"""
        count = int(self._client.kv[self._counter_path])
        count += 1
        count_str = str(count).zfill(self._COUNTER_FILL)
        self._client.kv[self._counter_path] = count_str
        return count_str
960018
def app_evaluation_count(app_id, value=1):
        '''
        
        '''
        return TabEvaluation.select().where(
            (TabEvaluation.post_id == app_id) & (TabEvaluation.value == value)
        ).count()
610191
def progress_stats(self, id): # pylint: disable=invalid-name,redefined-builtin
        
        schema = ProgressSchema()
        resp = self.service.get(self.base+str(id)+'/', params={'stats': 'progress'})
        return self.service.decode(schema, resp)
292994
Stream<String> writeCounter(Meter.Id id, double count) {
        if (Double.isFinite(count)) {
            return Stream.of(influxLineProtocol(id, "counter", Stream.of(new Field("value", count))));
        }
        return Stream.empty();
    }
29396
function rndid(len) {
  len = len || 8;
  const id = rndm(len);

  if (document.getElementById(id)) {
    return rndid(len);
  }

  return id;
}
1353984
function getCountFromGlobalAgent(data: Object) {
  let numUnassigned = 0;
  const domains = Object.keys(data);
  for (let x = 0; x < domains.length; x++) {
    const domain = data[domains[x]];
    if (domain && domain.length) {
      numUnassigned += domain.length;
    }
  }
  return numUnassigned;
}
1212234
public int getIdleTimeout()
    {
        stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING);
        return (int) TimeUnit.MILLISECONDS.convert(idleTimeoutInNanos, TimeUnit.NANOSECONDS);
    }
1047109
public long getCounter(final String iStatName) {
    if (iStatName == null)
      return -1;

    // CHECK IF STATISTICS ARE ACTIVED
    if (recording < 0)
      return -1;

    synchronized (counters) {
      Long stat = counters.get(iStatName);

      if (stat == null)
        return -1;

      return stat.longValue();
    }
  }