Perform a get_count in parallel on the given list<binary> keys. The return value maps keys to the count found.

    Parameters:
     - keys
     - column_parent
     - predicate
     - consistency_level
353223
def multiget_count(self, keys, column_parent, predicate, consistency_level):
    
    self._seqid += 1
    d = self._reqs[self._seqid] = defer.Deferred()
    self.send_multiget_count(keys, column_parent, predicate, consistency_level)
    return d
968209
void countNonZeroInR( int[] parent ) {
        TriangularSolver_DSCC.postorder(parent,n,post,gwork);
        columnCounts.process(A,parent,post,countsR);
        nz_in_R = 0;
        for (int k = 0; k < n; k++) {
            nz_in_R += countsR[k];
        }
        if( nz_in_R < 0)
            throw new RuntimeException("Too many elements. Numerical overflow in R counts");
    }
1496
def pks(self):
        """"""
        if self._primary_keys is None:
            self._primary_keys = list(
                self.queryset.values_list('pk', flat=True))
        return self._primary_keys
46840
protected List<Object> onCounterColumn(EntityMetadata m, boolean isRelation, List<String> relations,
        List<KeySlice> ks) {
        List<Object> entities;

        if (m.getType().isSuperColumnFamilyMetadata()) {
            if (log.isInfoEnabled()) {
                log.info("On counter column for super column family of entity {}.", m.getEntityClazz());
            }

            // TODO:: change it. remove column or super column helper
            Map<byte[], List<CounterSuperColumn>> results = new HashMap<byte[], List<CounterSuperColumn>>();

            List<CounterSuperColumn> counterColumns = null;
            for (KeySlice slice : ks) {
                counterColumns = new ArrayList<CounterSuperColumn>(slice.getColumnsSize());
                for (ColumnOrSuperColumn column : slice.columns) {
                    counterColumns.add(column.counter_super_column);
                }

                results.put(slice.getKey(), counterColumns);
            }

            entities = new ArrayList<Object>(results.size());

            for (byte[] key : results.keySet()) {
                Object e = null;
                Object id = PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(), key);
                List<CounterSuperColumn> counterSuperColumns = results.get(key);
                ThriftRow tr = new ThriftRow(id, m.getTableName(), new ArrayList<Column>(0),
                    new ArrayList<SuperColumn>(0), new ArrayList<CounterColumn>(0), counterSuperColumns);
                e = getDataHandler().populateEntity(tr, m, KunderaCoreUtils.getEntity(e), relations, isRelation);
                entities.add(e);
            }
        } else {
            if (log.isInfoEnabled()) {
                log.info("On counter column for column family of entity {}", m.getEntityClazz());
            }

            Map<byte[], List<CounterColumn>> results = new HashMap<byte[], List<CounterColumn>>();

            List<CounterColumn> counterColumns = null;

            for (KeySlice slice : ks) {
                counterColumns = new ArrayList<CounterColumn>(slice.getColumnsSize());
                for (ColumnOrSuperColumn column : slice.columns) {
                    counterColumns.add(column.counter_column);
                }

                results.put(slice.getKey(), counterColumns);
            }

            entities = new ArrayList<Object>(results.size());

            for (byte[] key : results.keySet()) {
                Object e = null;
                Object id = PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(), key);

                List<CounterColumn> columns = results.get(key);
                ThriftRow tr = new ThriftRow(id, m.getTableName(), new ArrayList<Column>(0),
                    new ArrayList<SuperColumn>(0), columns, new ArrayList<CounterSuperColumn>(0));
                e = getDataHandler().populateEntity(tr, m, KunderaCoreUtils.getEntity(e), relations, isRelation);

                if (e != null) {
                    entities.add(e);
                }
            }
        }
        return entities;
    }
86972
def returner(ret):
    '''
    
    '''

    consistency_level = getattr(pycassa.ConsistencyLevel,
                                __opts__['cassandra.consistency_level'])

    pool = pycassa.ConnectionPool(__opts__['cassandra.keyspace'],
                                  __opts__['cassandra.servers'])
    ccf = pycassa.ColumnFamily(pool, __opts__['cassandra.column_family'],
                               write_consistency_level=consistency_level)

    columns = {'fun': ret['fun'],
               'id': ret['id']}
    if isinstance(ret['return'], dict):
        for key, value in six.iteritems(ret['return']):
            columns['return.{0}'.format(key)] = six.text_type(value)
    else:
        columns['return'] = six.text_type(ret['return'])

    log.debug(columns)
    ccf.insert(ret['jid'], columns)
327953
def get_bindings_for_keys(self, keys):
        
        def get():
            result = []
            for b in self.key_bindings:
                if len(keys) == len(b.keys):
                    match = True
                    any_count = 0

                    for i, j in zip(b.keys, keys):
                        if i != j and i != Keys.Any:
                            match = False
                            break

                        if i == Keys.Any:
                            any_count += 1

                    if match:
                        result.append((any_count, b))

            # Place bindings that have more 'Any' occurences in them at the end.
            result = sorted(result, key=lambda item: -item[0])

            return [item[1] for item in result]

        return self._get_bindings_for_keys_cache.get(keys, get)
1041515
def _insert(self, key, records, count):
        
        if key not in self.records:
            assert key not in self.counts
            self.records[key] = records
            self.counts[key] = count
        else:
            self.records[key] = np.vstack((self.records[key], records))
            assert key in self.counts
            self.counts[key] += count
778685
def get_multi_async(cls, blob_keys, **ctx_options):
    """"""
    for blob_key in blob_keys:
      if not isinstance(blob_key, (BlobKey, basestring)):
        raise TypeError('Expected blob key, got %r' % (blob_key,))
    if 'parent' in ctx_options:
      raise TypeError('Parent is not supported')
    blob_key_strs = map(str, blob_keys)
    keys = [model.Key(BLOB_INFO_KIND, id) for id in blob_key_strs]
    return model.get_multi_async(keys, **ctx_options)
994213
def columnCount(self, parent=None):
        
        if self._separateFieldOrientation == Qt.Horizontal:
            return self._nCols * len(self._fieldNames)
        else:
            return self._nCols
120772
def popmin_compat(self, count=1):
        
        pipe = self.database.pipeline()
        r1, r2 = (pipe
                  .zrange(self.key, 0, count - 1, withscores=True)
                  .zremrangebyrank(self.key, 0, count - 1)
                  .execute())
        return r1
1121609
def columnCount(self, parent):
        
        # print("columnCount:",self)
        if parent.isValid():
            return parent.internalPointer().columnCount()
        else:
            return self.root.columnCount()
1193869
def count(self, Class, set=None, recursive=True,  ignore=True, node=None):
        
        return sum(1 for i in self.select(Class,set,recursive,ignore,node) )
794218
def count_entities_or_keys(self, *args, forward=None):
        
        if forward is None:
            forward = self.db._forward
        entity = args[:-3]
        branch, turn, tick = args[-3:]
        if self.db._no_kc:
            return len(self._get_adds_dels(self.keys[entity], branch, turn, tick)[0])
        return len(self._get_keycache(entity, branch, turn, tick, forward=forward))
499787
public static int countByG_K_T(long groupId, String key, int type) {
		return getPersistence().countByG_K_T(groupId, key, type);
	}
412075
@Override
	public int countByC_K(long CPDefinitionOptionRelId, String key) {
		FinderPath finderPath = FINDER_PATH_COUNT_BY_C_K;

		Object[] finderArgs = new Object[] { CPDefinitionOptionRelId, key };

		Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);

		if (count == null) {
			StringBundler query = new StringBundler(3);

			query.append(_SQL_COUNT_CPDEFINITIONOPTIONVALUEREL_WHERE);

			query.append(_FINDER_COLUMN_C_K_CPDEFINITIONOPTIONRELID_2);

			boolean bindKey = false;

			if (key == null) {
				query.append(_FINDER_COLUMN_C_K_KEY_1);
			}
			else if (key.equals("")) {
				query.append(_FINDER_COLUMN_C_K_KEY_3);
			}
			else {
				bindKey = true;

				query.append(_FINDER_COLUMN_C_K_KEY_2);
			}

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(CPDefinitionOptionRelId);

				if (bindKey) {
					qPos.add(key);
				}

				count = (Long)q.uniqueResult();

				finderCache.putResult(finderPath, finderArgs, count);
			}
			catch (Exception e) {
				finderCache.removeResult(finderPath, finderArgs);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return count.intValue();
	}
940332
def add(self, key, column_parent, column, consistency_level):
    
    self._seqid += 1
    d = self._reqs[self._seqid] = defer.Deferred()
    self.send_add(key, column_parent, column, consistency_level)
    return d
286877
def lex_count(self, low, high):
        
        return self.database.zlexcount(self.key, low, high)