Returns the number of the machine which key gets sent to.
173912
def get_machine(self, key):
        
        h = self.hash(key)

        # edge case where we cycle past hash value of 1 and back to 0.
        if h > self.hash_tuples[-1][2]:
            return self.hash_tuples[0][0]

        hash_values = map(lambda x: x[2], self.hash_tuples)
        index = bisect.bisect_left(hash_values, h)
        return self.hash_tuples[index][0]
293746
def objectcount(data, key):
    """"""
    objkey = key.upper()
    return len(data.dt[objkey])
762547
public int getIntCount(Object key) {
    MutableInteger count =  map.get(key);
    if (count == null) {
      return defaultValue; // haven't seen this object before -> 0 count
    }
    return count.intValue();
  }
119059
def machine_to_machine(self):
        
        if self._machine_to_machine is None:
            self._machine_to_machine = MachineToMachineList(
                self._version,
                account_sid=self._solution['account_sid'],
                country_code=self._solution['country_code'],
            )
        return self._machine_to_machine
770057
def _get_key_location(self, key) -> (int, int):
        
        key = int(key)
        if key == 0:
            return 1, 0
        remainder = key % self.chunkSize
        addend = ChunkedFileStore.firstChunkIndex
        chunk_no = key - remainder + addend if remainder \
            else key - self.chunkSize + addend
        offset = remainder or self.chunkSize
        return chunk_no, offset
1012646
public int getRegisteredResourceRequestCount(K key) {
        if(requestQueueMap.containsKey(key)) {
            Queue<AsyncResourceRequest<V>> requestQueue = getRequestQueueForExistingKey(key);
            // FYI: .size() is not constant time in the next call. ;)
            if(requestQueue != null) {
                return requestQueue.size();
            }
        }
        return 0;
    }
1040096
public int getDelegationKeyCacheLifetime() {

        int valueInt = 0;

        String valueStr = System.getProperty(DELEGATION_KEY_CACHE_LIFETIME);

        if (valueStr != null && valueStr.length() > 0) {
            int parsedvalueInt = Integer.parseInt(valueStr);
            if (parsedvalueInt > 0) {
                valueInt = parsedvalueInt;
            }
        }

        if (valueInt == -1) { // Didn't find a system property
            valueStr = getProperty(DELEGATION_KEY_CACHE_LIFETIME);
            if (valueStr != null && valueStr.length() > 0) {
                int parsedvalueInt = Integer.parseInt(valueStr);
                if (parsedvalueInt > 0) {
                    valueInt = parsedvalueInt;
                }
            }
        }
        return valueInt;
    }
17858
async function generateMachineKey () {
  let parts = await Promise.all([
    randomHex(8),
    randomHex(4),
    randomHex(4),
    randomHex(4),
    randomHex(12)
  ])
  return `${parts[0]}-${parts[1]}-${parts[2]}-${parts[3]}-${parts[4]}`
}
104401
public int getKeySeq()
    {   // This is a dumb way to do this
        int iLastIndexArea = m_record.getKeyAreaCount() - 1 + DBConstants.MAIN_KEY_AREA;
        for (int nIndex = DBConstants.MAIN_KEY_AREA; nIndex <= iLastIndexArea; nIndex++)
        {
            KeyAreaInfo index = m_record.getKeyArea(nIndex);
            if (index == null)
                return -1;  // Not found
            if (this == index)
                return nIndex;      // Zero based . MAIN_FIELD based
        }
        return -1;  // Not found
    }
478641
def GetMemActiveMB(self):
        ''''''
        counter = c_uint()
        ret = vmGuestLib.VMGuestLib_GetMemActiveMB(self.handle.value, byref(counter))
        if ret != VMGUESTLIB_ERROR_SUCCESS: raise VMGuestLibException(ret)
        return counter.value
1220117
public int getCount (K key)
    {
        CountEntry<K> entry = _backing.get(key);
        return (entry == null) ? 0 : entry.count;
    }
1022012
def machine(self):
        
        machine_id = self.safe_data['machine-id']
        if machine_id:
            return self.model.machines.get(machine_id, None)
        else:
            return None
1118564
def get_key(raw=False):
    
    while True:
        try:
            if kbhit():
                char = getch()
                ordinal = ord(char)
                if ordinal in (0, 224):
                    extention = ord(getch())
                    scan_code = ordinal + extention * 256
                    result = scan_codes.get(scan_code)
                    break
                else:
                    result = char.decode()
                    break
        except KeyboardInterrupt:
            return "ctrl-c"
    return result if raw else keys_flipped.get(result, result)
1348706
private int getKeyIndex(int key) {
    reindexItems();

    int index = Arrays.binarySearch(sortedKeys, key);
    if (index >= 0) {
      int prevIndex = index - 1;
      while (prevIndex >= 0 && sortedKeys[prevIndex] == key) {
        index = prevIndex;
        prevIndex = index - 1;
      }
      return index;
    } else {
      return -1;
    }
  }
289617
def get(self, key):
        ''''''
        if key in self and len(self[key]) > 0:
            return min(self[key])
        else:
            return 0
1079400
function lookupCount(state, bindings, key) {
  if(key in bindings) {
    var arr = bindings[key], r = 0
    for(var i=0, n=arr.length; i<n; ++i) {
      r += state[virtualKeyCode(arr[i])]
    }
    return r
  }
  var kc = virtualKeyCode(key)
  if(kc >= 0) {
    return state[kc]
  }
  return 0
}
984210
def get_machine_usage(machine, start, end):
    

    try:
        cache = MachineCache.objects.get(
            machine=machine, date=datetime.date.today(),
            start=start, end=end)
        return cache.cpu_time, cache.no_jobs
    except MachineCache.DoesNotExist:
        return 0, 0