Get the number of fields in a hash.
974458
function hlen(key, req) {
  var val = this.getKey(key, req);
  if(!val) return 0;
  return val.hlen();
}
426300
def get_fields(cls):
        
        fields = {}
        for field_name in dir(cls):
            if isinstance(getattr(cls, field_name), Field):
                field = getattr(cls, field_name)
                field_name = field.field_name or field_name
                fields[field_name] = field
        return fields
1021445
def _get_block_number(self, block_hash):
        
        number_key = block_hash_prefix + block_hash
        return self.db.get(number_key)
237135
def get_count(self, prefix=''):
        """"""
        return sum([self.counters[key]
                    for key in self.messages if key.startswith(prefix)])
1326370
public function getFieldNum($fieldName)
    {
        foreach( $this->_fields as $field ) {
            if( $field->name == $fieldName ) {
                return $field->number;
            }
        }

        return -1;
    }
481712
function(){
        var fieldNames = [], i, n = this._fieldCount;
        for (i = 0; i < n; i++) fieldNames[i] = this.fieldOrder[i];
        return fieldNames;
    }
1371774
public Integer getNumberOfTokens(String field, int docId) {
    if (fieldReferences.containsKey(field)) {
      IndexDoc doc = getDoc(field, docId);
      if (doc != null) {
        return doc.size;
      }
    }
    return null;
  }
664583
def to_hash
      result = {}

      @values.keys.each do |field_name|
        value = __send__(field_name)
        hashed_value = value.respond_to?(:to_hash_value) ? value.to_hash_value : value
        result.merge!(field_name => hashed_value)
      end

      result
    end
197493
def get_subhash(hash):
    
    idx = [0xe, 0x3, 0x6, 0x8, 0x2]
    mul = [2, 2, 5, 4, 3]
    add = [0, 0xd, 0x10, 0xb, 0x5]

    b = []
    for i in range(len(idx)):
        a = add[i]
        m = mul[i]
        i = idx[i]
        t = a + int(hash[i], 16)
        v = int(hash[t:t + 2], 16)
        b.append(('%x' % (v * m))[-1])

    return ''.join(b)
484964
def _field(self, *keys) -> Any:
        """"""
        try:
            d = self._node
            for key in keys:
                d = d[key]
            return d
        except KeyError:
            d = self._full_metadata
            for key in keys:
                d = d[key]
            return d
170525
def each
      pos = hash_size
      hoff0 = @hashes[0]
      while pos < hoff0
        key, value = *read_entry(pos)
        yield(key,value)
        pos += key.length + value.length + hashref_size
      end
    end
295348
def number_of_extents(self):
    """"""
    if not self._is_parsed:
      self._Parse()
      self._is_parsed = True

    return len(self._extents)
90012
def get_count(self):
        
        params = self.get_params()
        params["offset"] = self.low_mark
        params["limit"] = 1

        r = self.resource._meta.api.http_resource("GET", self.resource._meta.resource_name, params=params)
        data = self.resource._meta.api.resource_deserialize(r.text)

        number = data["meta"]["total_count"]

        # Apply offset and limit constraints manually, since using limit/offset
        # in the API doesn't change the total_count output.
        number = max(0, number - self.low_mark)
        if self.high_mark is not None:
            number = min(number, self.high_mark - self.low_mark)

        return number
971669
def find_fields name
      res = {}
      @lines.each do | line |
        value = line.scan(/###{name}=<(.*)>/)
        if value[0]
          str = value[0][0]
          # p str
          v = VcfHeaderParser.parse_field(line,@debug)
          id = v['ID']
          res[id] = v
        end
      end
      # p res
      res
    end
1034010
def getNumTables(dbid)
      numTables = 0
      dbid ||= @dbid
      if getSchema(dbid)      
        if @chdbids
           chdbidArray = findElementsByAttributeName( @chdbids, "name" )
           numTables = chdbidArray.length
         end
       end
      numTables       
  end
393649
def get_fields(desc2nts):
        """"""
        if 'flat' in desc2nts:
            nts_flat = desc2nts.get('flat')
            if nts_flat:
                return nts_flat[0]._fields
        if 'sections' in desc2nts:
            nts_sections = desc2nts.get('sections')
            if nts_sections:
                return nts_sections[0][1][0]._fields
254175
def get_count(self, instance):
        
        instance = instance[1]
        return serializers.IntegerField(read_only=True).to_representation(instance)