get unmapped reads
779385
def unmapped(sam, mates):
    
    for read in sam:
        if read.startswith('@') is True:
            continue
        read = read.strip().split()
        if read[2] == '*' and read[6] == '*':
                yield read
        elif mates is True:
            if read[2] == '*' or read[6] == '*':
                yield read
            for i in read:
                if i == 'YT:Z:UP':
                    yield read
637027
def buffered_read(fh, lock, offsets, bytecounts, buffersize=None):
    """"""
    if buffersize is None:
        buffersize = 2**26
    length = len(offsets)
    i = 0
    while i < length:
        data = []
        with lock:
            size = 0
            while size < buffersize and i < length:
                fh.seek(offsets[i])
                bytecount = bytecounts[i]
                data.append(fh.read(bytecount))
                # buffer = bytearray(bytecount)
                # n = fh.readinto(buffer)
                # data.append(buffer[:n])
                size += bytecount
                i += 1
        for segment in data:
            yield segment
58123
def unread_data(self, data: bytes) -> None:
        
        warnings.warn("unread_data() is deprecated "
                      "and will be removed in future releases (#3260)",
                      DeprecationWarning,
                      stacklevel=2)
        if not data:
            return

        if self._buffer_offset:
            self._buffer[0] = self._buffer[0][self._buffer_offset:]
            self._buffer_offset = 0
        self._size += len(data)
        self._cursor -= len(data)
        self._buffer.appendleft(data)
        self._eof_counter = 0
985532
def _unassembled_reads1_out_file_name(self):
        """"""
        if self.Parameters['-1'].isOn():
            unassembled_reads1 = self._absolute(
                str(self.Parameters['-1'].Value))
        else:
            raise ValueError("No reads1 (flag: -1) output path specified")
        return unassembled_reads1
490409
def read_some(self):
        
        self.process_rawq()
        while self.cookedq.tell() == 0 and not self.eof:
            self.fill_rawq()
            self.process_rawq()
        buf = self.cookedq.getvalue()
        self.cookedq.seek(0)
        self.cookedq.truncate()
        return buf
47653
def _traverse_unobserved(stream,negative_filter,of):
  """"""
  observed = set()
  for line in stream:
    name = PacBioReadName(_nameprog.match(line).group(1))
    if name.get_molecule() not in negative_filter: of.write(line)
    observed.add(name.get_molecule())
  return negative_filter|observed
1089935
def readers(self):
        
        return list((fd, data) for fd, (data, gen) in self._rfds.items())
83661
def unstructured_mappers(self):
        
        return filter(lambda m: path_type.UNSTRUCTURED in m.path_types, self.mappers)
1030626
def internal_reader(self, input_stream):
        
        for input_line in input_stream:
            yield list(map(self.deserialize, input_line.split("\t")))
128957
def get_unattached_volumes(self):
        
        volumes = {}
        ignored_tags = dbconfig.get('ignore_tags', self.ns)
        for volume in EBSVolume.get_all().values():
            issue_id = get_resource_id('evai', volume.id)

            if len(volume.attachments) == 0:
                if len(list(filter(set(ignored_tags).__contains__, [tag.key for tag in volume.tags]))):
                    continue

                volumes[issue_id] = volume

        return volumes
554392
protected Iterable<String> readtext(String name, boolean unescapeNewlines) throws IOException {
    ArrayList<String> res = new ArrayList<>(50);
    BufferedReader br = _reader.getTextFile(name);
    try {
      String line;
      while (true) {
        line = br.readLine();
        if (line == null) break;
        if (unescapeNewlines)
          line = StringEscapeUtils.unescapeNewlines(line);
        res.add(line.trim());
      }
      br.close();
    } finally {
      try { br.close(); } catch (IOException e) { /* ignored */ }
    }
    return res;
  }
643122
private void checkUnmappedElements(List<T> offspring,
                                       Map<T, T> mapping,
                                       int mappingStart,
                                       int mappingEnd)
    {
        for (int i = 0; i < offspring.size(); i++)
        {
            if (!isInsideMappedRegion(i, mappingStart, mappingEnd))
            {
                T mapped = offspring.get(i);
                while (mapping.containsKey(mapped))
                {
                    mapped = mapping.get(mapped);
                }
                offspring.set(i, mapped);
            }
        }
    }
346072
def _unmarshall_reader(self, file_, d):
        """"""
        return util.unmarshall_config_reader(file_, d, self._get_config_type())
70635
def reader(stream, fieldnames=None):
    """"""
    if not fieldnames:
        fieldnames = load_line(stream.readline())
    for line in stream:
        values = load_line(line)
        item = Item()
        item.__dict__ = dict(zip(fieldnames, values))
        yield item
1021712
def _unpaginated(what):
    ''''''
    page = data(what)
    results = page['results']
    count = page['count']
    while page['next']:
        page = data(page['next'])
        results += page['results']
        count += page['count']
    return {'results': results, 'count': count}
844036
def read(self, include_deleted=False):
        """"""
        if is_soft_delete() and not include_deleted:
            return self.filter(unread=False, deleted=False)

        # When SOFT_DELETE=False, developers are supposed NOT to touch 'deleted' field.
        # In this case, to improve query performance, don't filter by 'deleted' field
        return self.filter(unread=False)
127081
def get_readers(self, obj):
        
        try:
            o = compat_serializer_attr(self, obj)
            return o.readers
        except Exception:
            return []