get the record by first key
550696
function _get_record($key)
	{
		$this->_io_times = 1;
		$index = ($this->hash_prime > 1 ? $this->_get_index($key) : 0);
		$poff = $index * 8 + 32;
		fseek($this->fd, $poff, SEEK_SET);
		$buf = fread($this->fd, 8);

		if (strlen($buf) == 8) $tmp = unpack('Ioff/Ilen', $buf);
		else $tmp = array('off' => 0, 'len' => 0);
		return $this->_tree_get_record($tmp['off'], $tmp['len'], $poff, $key);
	}
1070865
public int getOrElse (int key, int defval)
    {
        Record rec = locateRecord(key);
        return (rec == null) ? defval : rec.value;
    }
690412
function getRecords(records, config, accum = {}) {
  if ( Object.keys(RecordRegistry).length === 0 ) { return {} }
  return Object.keys(records)
    .reduce( (p, c) => getRecord(c, records[c], config, p), accum )
}
919686
def first(self):
        """"""
        with self.lock:
            try:
                return self.data[0][0]
            except IndexError as ex:
                ex.args = ('DEPQ is empty',)
                raise
486656
def collections(record, key, value):
    """"""
    return {
        'primary': value.get('a'),
        'secondary': value.get('b'),
        'deleted': value.get('c'),
    }
72099
def first(self):
        """"""
        if self._results_cache:
            return self._results_cache[0]

        query = PaginatedResponse(func=self._func, lwrap_type=self._lwrap_type, **self._kwargs)
        try:
            return next(query)
        except StopIteration:
            return None
88554
def one(self, default=None, as_dict=False, as_ordereddict=False):
        """"""

        # Ensure that we don't have more than one row.
        try:
            self[1]
        except IndexError:
            return self.first(default=default, as_dict=as_dict, as_ordereddict=as_ordereddict)
        else:
            raise ValueError('RecordCollection contained more than one row. '
                             'Expects only one row when using '
                             'RecordCollection.one')
1296324
def get(self, key):
        """"""
        self._started = self._backend_client.load()
        self._needs_save = True

        return self._backend_client.get(key)
915960
def get_one(self, section, key):
        
        lines = iter(self.get(section, key))
        try:
            return next(lines)
        except StopIteration:
            raise KeyError("Key %s not found in %s" % (key, section))
507855
public Record findFirst(String sql, Object... paras) {
		List<Record> result = find(sql, paras);
		return result.size() > 0 ? result.get(0) : null;
	}
915170
def count_by(records: Sequence[Dict], field_name: str) -> defaultdict:
    

    counter = defaultdict(int)

    for record in records:
        name = record[field_name]
        counter[name] += 1

    return counter
1201815
public final function findFirst()
    {
        //odpytanie adaptera o rekordy
        $result = DbConnector::getAdapter()->select($this->_prepareFields(), $this->_prepareFrom(), $this->_query->getQueryCompile()->where, $this->_query->getQueryCompile()->groupBy, $this->_query->getQueryCompile()->order, 1, $this->_query->getQueryCompile()->offset, $this->_query->getQueryCompile()->bind);
        //null jeśli brak danych
        if (!is_array($result) || !isset($result[0])) {
            return null;
        }
        //ustalenie klasy rekordu
        $recordName = $this->_query->getRecordName();
        /* @var $record RecordRo */
        $record = new $recordName;
        return $record->setFromArray($result[0])->clearModified();
    }
1047151
@Nullable
  public synchronized K getFirstKey() {
    return mMap.isEmpty() ? null : mMap.keySet().iterator().next();
  }
201288
public String getFirst(String key)
    {
        if(key == null)
            throw new IllegalArgumentException("Null keys not allowed.");

        List<String> vals = map.get(key);
        if(vals == null || vals.size() == 0)
            return null;

        return vals.get(0);
    }
838019
def find(self, id, **kwargs):
        
        return self.find_by(values={self.primary_key: id}, **kwargs)
88032
public function first()
    {
        $this->throwExceptionIfEmpty();

        $keys = $this->keys();
        $keyOfTheFirstElement = $keys->shift();
        return $this->offsetGet($keyOfTheFirstElement);
    }
414559
def _get_first_all_link_record(self):
        """"""
        _LOGGER.debug("Starting: _get_first_all_link_record")
        _LOGGER.info('Requesting ALL-Link Records')
        if self.aldb.status == ALDBStatus.LOADED:
            self._next_all_link_rec_nak_retries = 3
            self._handle_get_next_all_link_record_nak(None)
            return
        self.aldb.clear()
        self._next_all_link_rec_nak_retries = 0
        msg = GetFirstAllLinkRecord()
        self.send_msg(msg, wait_nak=True, wait_timeout=.5)
        _LOGGER.debug("Ending: _get_first_all_link_record")