GET /mnoe/jpi/v1/admin/users/count
558881
def count
      users_count = MnoEnterprise::Tenant.get('tenant').users_count
      render json: {count: users_count }
    end
1105377
function getIndexStats(done, results) {
  var client = results.client;
  var ns = mongodbNS(results.namespace);
  var pipeline = [
    { $indexStats: {} },
    {
      $project: {
        name: 1,
        usageHost: '$host',
        usageCount: '$accesses.ops',
        usageSince: '$accesses.since'
      }
    }
  ];
  var collection = client.db(ns.database).collection(ns.collection);
  collection.aggregate(pipeline, { cursor: {} }).toArray(function(err, res) {
    if (err) {
      if (isNotAuthorizedError(err)) {
        /**
         * In the 3.2 server, `readWriteAnyDatabase@admin` does not grant sufficient privileges for $indexStats.
         * The `clusterMonitor` role is required to run $indexStats.
         * @see https://jira.mongodb.org/browse/INT-1520
         */
        return done(null, {});
      }

      if (err.message.match(/Unrecognized pipeline stage name/)) {
        // $indexStats not yet supported, return empty document
        return done(null, {});
      }
      done(err);
    }
    res = _.mapKeys(res, function(stat) {
      return stat.name;
    });
    done(null, res);
  });
}
1368936
def count(self):
        
        params = self.dump()
        params['limit'] = 0
        params['count'] = 1
        content = self._do_request(params)
        return content['count']
572167
public void usersCountByTemplateIdAndPermission(DbSession dbSession, List<Long> templateIds, ResultHandler<CountByTemplateAndPermissionDto> resultHandler) {
    Map<String, Object> parameters = new HashMap<>(1);

    executeLargeInputsWithoutOutput(
      templateIds,
      partitionedTemplateIds -> {
        parameters.put("templateIds", partitionedTemplateIds);
        mapper(dbSession).usersCountByTemplateIdAndPermission(parameters, resultHandler);
      });
  }
741858
public function count($type='admin.web')
    {
        return $this->task->scopeQuery(function($query)use($type){
                return $query->whereUserId(user_id($type))
                            ->whereUserType(user_type($type));
            })->count();
    }
1005034
def count(self):
        """"""
        if self._primary_keys is None:
            return self.queryset.count()
        else:
            return len(self.pks)
500515
public UserListResult getUserList(int start, int count)
            throws APIConnectionException, APIRequestException {
        return _userClient.getUserList(start, count);
    }
1153067
function getUserdata0_(username, upNamespace, envVars_, origUsername) {
  var envVars = cleanEnvVars(upNamespace, envVars_);

  var script  = [
                "#!/bin/bash -ex",
         format("if ! [ -d /home/%s ]; then", username),
         format("  usermod -l %s %s", username, origUsername),
         format("  groupmod -n %s %s", username, origUsername),
         format("  usermod  -d /home/%s -m %s", username, username),
                "fi",

         format("if [ -f /etc/sudoers.d/90-cloudimg-%s ]; then", origUsername),
         format("  mv /etc/sudoers.d/90-cloudimg-%s /etc/sudoers.d/90-cloud-init-users", origUsername),
                "fi",
         format("perl -pi -e 's/%s/%s/g;' /etc/sudoers.d/90-cloud-init-users", origUsername, username),

                "if ! grep `hostname` /etc/hosts; then",
                "  echo \"127.0.0.1 `hostname`\" | sudo tee -a /etc/hosts",
                "fi",
                ""
  ];
  _.each(envVars, function(value, key) {
    script.push("echo "+key+"="+value+" | sudo tee -a /etc/environment");
  });
  script.push(  "");

  console.error(script);
  return script;
}
301677
public int getRequestCount() {
        synchronized (mapPluginStats) {
            int count = requestCount + getAnalyser().getRequestCount();
            for (PluginStats stats : mapPluginStats.values()) {
                count += stats.getMessageCount();
            }
            return count;
        }
    }
862733
def count(request_criteria)
      return if ::ServiceMock.disable_stubs
      yield self if block_given?
      JSON.parse(http.post('/__admin/requests/count', request_criteria).body)['count']
    end
1339681
public function getCount(EntityManager $em, Request $request)
	{
		$stmt = $this->buildCountQuery($em, $request);
		$stmt->execute();
		return (int) $stmt->fetchColumn();
	}
1103614
public function getCount( $collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = [] )
	{
		$query = $this->table( $collection )->where( $column, '=', $value );

		if ( !is_null( $excludeId ) && $excludeId != 'NULL' )
		{
			$query->where( $idColumn ?: 'id', '<>', $excludeId );
		}

		foreach ( $extra as $key => $extraValue )
		{
			$this->addWhere( $query, $key, $extraValue );
		}

		return $query->count();
	}
763880
public int countUsersWithGlobalPermissionExcludingUser(DbSession dbSession, String organizationUuid,
    String permission, int excludedUserId) {
    return mapper(dbSession).countUsersWithGlobalPermissionExcludingUser(organizationUuid, permission, excludedUserId);
  }
837155
def get_user_paginator(
        cls,
        instance,
        page=1,
        item_count=None,
        items_per_page=50,
        user_ids=None,
        GET_params=None,
    ):
        
        if not GET_params:
            GET_params = {}
        GET_params.pop("page", None)
        query = instance.users_dynamic
        if user_ids:
            query = query.filter(cls.models_proxy.UserGroup.user_id.in_(user_ids))
        return SqlalchemyOrmPage(
            query,
            page=page,
            item_count=item_count,
            items_per_page=items_per_page,
            **GET_params
        )
494793
static function countWithSubscriberID( $subscriberID, $languageID =false , $enabled = false )
    {
        $cond = array();
        $cond['subscriber_id'] = $subscriberID;
        if ( $enabled !== false )
        {
            $cond['enabled'] = $enabled;
        }
        if ( $languageID !== false )
        {
            $cond['language_id'] = $languageID;
        }
        $count = eZPersistentObject::count( self::definition(), $cond );
        return $count;
    }
670903
public UserListResult getAdminListByAppkey(int start, int count)
            throws APIConnectionException, APIRequestException {
        if (start < 0 || count <= 0 || count > 500) {
            throw new IllegalArgumentException("negative index or count must more than 0 and less than 501");
        }
        ResponseWrapper response = _httpClient.sendGet(_baseUrl + adminPath + "?start=" + start + "&count=" + count);
        return UserListResult.fromResponse(response, UserListResult.class);

    }
329296
public int getCount() throws InterruptedException, KeeperException {
        return ByteBuffer.wrap(m_zk.getData(m_path, false, null)).getInt();
    }