Returns the first record in the fastafile
491757
def get_first_rec(fastafile):
    
    f = list(SeqIO.parse(fastafile, "fasta"))

    if len(f) > 1:
        logging.debug("{0} records found in {1}, using the first one".
                      format(len(f), fastafile))

    return f[0]
734631
def FastaIter(handle):
    

    header = None
    for line in handle:
        if line.startswith(">"):
            if header is not None:  # not the first record
                yield header, "".join(seq_lines)
            seq_lines = list()
            header = line[1:].rstrip()
        else:
            if header is not None:  # not the first record
                seq_lines.append(line.strip())

    if header is not None:
        yield header, "".join(seq_lines)
    else:   # no FASTA records in file
        return
328558
@Override
    public Record nextRecord() {
        if(!hasNext()){ //Also triggers prefetch
            throw new NoSuchElementException("No next element");
        }
        Record toRet = next;
        next = null;
        return toRet;
    }
248594
def get_record(uid=None):
    
    obj = None
    if uid is not None:
        obj = get_object_by_uid(uid)
    else:
        obj = get_object_by_request()
    if obj is None:
        fail(404, "No object found")
    complete = req.get_complete(default=_marker)
    if complete is _marker:
        complete = True
    items = make_items_for([obj], complete=complete)
    return u.first(items)
500035
def first(self):
        
        if self.mode == 'local':
            return self.values[0]

        if self.mode == 'spark':
            return self.values.first().toarray()
379882
def where_earliest(cls, user_id):
        
        return cls.query.filter_by(user_id=user_id)\
            .order_by(cls.created_at.asc()).first()
344541
def next(self):
        
        if self._records_iter >= len(self._records):
            raise StopIteration
        self._records_iter += 1
        return self._records[self._records_iter - 1]
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')
582224
def _first(self, query):
        """"""
        result = query.first()
        if result is None:
            raise NotFoundError
        else:
            if result.has_expired(self._expirations):
                raise NotFoundError
            return result
51001
def first(self):
        

        if not self._stream:
            raise InvalidUsage('first() is only available when stream=True')

        try:
            content = next(self.all())
        except StopIteration:
            raise NoResults("No records found")

        return content
261604
public Record getRecord(String strFileName)
    {
        if (m_screenParent != null)
            return m_screenParent.getRecord(strFileName); // Look thru the parent window now
        else
            return null;
    }
1217819
def first(self):
        """"""
        # we need to create a new object to insure we don't corrupt the generator count
        csvsource = CSVSource(self.source, self.factory, self.key())
        try:
            item = csvsource.items().next()
            return item
        except StopIteration:
            return None
633227
def get_first_result(threads):
    
    while True:
        for thread in threads:
            if not thread.is_alive():
                return thread.queue.get()
816111
public function getFirst()
    {
        if (0 === count($this->data)) {
            return null;
        }
        reset($this->data);

        return current($this->data);
    }
821737
def first(self):
        
        results = self.rpc_model.search_read(
            self.domain, None, 1, self._order_by, self.fields,
            context=self.context
        )
        return results and results[0] or None
507855
public Record findFirst(String sql, Object... paras) {
		List<Record> result = find(sql, paras);
		return result.size() > 0 ? result.get(0) : null;
	}
777826
def getFirstUrn(self, reference=None):
        
        if reference is not None:
            if ":" in reference:
                urn = reference
            else:
                urn = "{}:{}".format(
                    str(URN(str(self.urn)).upTo(URN.NO_PASSAGE)),
                    str(reference)
                )
        else:
            urn = str(self.urn)
        _first = _SharedMethod.firstUrn(
            self.retriever.getFirstUrn(
                urn
            )
        )
        return _first