Retrieve the next offsets
        :param Descriptor self: this
        :rtype: Offsets
        :return: download offsets
774856
def next_offsets(self):
        # type: (Descriptor) -> Offsets
        
        resume_bytes = self._resume()
        if resume_bytes is None and not self._allocated:
            self._allocate_disk_space()
        with self._meta_lock:
            if self._offset >= self._ase.size:
                return None, resume_bytes
            if self._offset + self._chunk_size > self._ase.size:
                chunk = self._ase.size - self._offset
            else:
                chunk = self._chunk_size
            # on download, num_bytes must be offset by -1 as the x-ms-range
            # header expects it that way. x -> y bytes means first bits of the
            # (x+1)th byte to the last bits of the (y+1)th byte. for example,
            # 0 -> 511 means byte 1 to byte 512
            num_bytes = chunk - 1
            chunk_num = self._chunk_num
            fd_start = self._offset
            range_start = self._offset
            if self._ase.is_encrypted:
                # ensure start is AES block size aligned
                range_start = range_start - \
                    (range_start % self._AES_BLOCKSIZE) - \
                    self._AES_BLOCKSIZE
                if range_start <= 0:
                    range_start = 0
            range_end = self._offset + num_bytes
            self._offset += chunk
            self._chunk_num += 1
            if self._ase.is_encrypted and self._offset >= self._ase.size:
                unpad = True
            else:
                unpad = False
            return Offsets(
                chunk_num=chunk_num,
                fd_start=fd_start,
                num_bytes=chunk,
                range_start=range_start,
                range_end=range_end,
                unpad=unpad,
            ), resume_bytes
1039944
def _next_page(self, offset):
        """"""
        self._log.debug("Iterator c_record={}".format(self.c_record))
        page_size = self.page_size
        if (offset + page_size) > self.max_records:
            page_size = self.max_records - offset
        param_dict = self.query_dict.copy()
        param_dict.update(
            {
                'start': str(offset),
                'rows': str(page_size),
                'explainOther': '',
                'hl.fl': '',
            }
        )
        self.res = self.client.search(**param_dict)
        self._num_hits = int(self.res['response']['numFound'])
950102
def _getPaddingDataToSectionOffset(self):
        
        start = self._getPaddingToSectionOffset()
        end = self.sectionHeaders[0].pointerToRawData.value - start
        return self._data[start:start+end]
838127
private static long getNextPageOffset(final int offset, final int limit, final long total) {
        return hasFullNextPage(offset, limit, total) ? getNextFullPageOffset(offset, limit) : getLastPageOffset(total, limit);
    }
500713
def offset(self):
    """"""
    if not self._registry_key and self._registry:
      self._GetKeyFromRegistry()

    if not self._registry_key:
      return None

    return self._registry_key.offset
589433
def fetch_offsets(zk, consumer_group, topics):
    
    source_offsets = defaultdict(dict)
    for topic, partitions in six.iteritems(topics):
        for partition in partitions:
            offset, _ = zk.get(
                "/consumers/{groupid}/offsets/{topic}/{partition}".format(
                    groupid=consumer_group,
                    topic=topic,
                    partition=partition,
                )
            )
            source_offsets[topic][partition] = offset
    return source_offsets
76825
private List<MergedIndexEntry> getAllEntries(long offsetAdjustment) {
        Exceptions.checkArgument(offsetAdjustment >= 0, "offsetAdjustment", "offsetAdjustment must be a non-negative number.");

        synchronized (this.lock) {
            List<MergedIndexEntry> result = new ArrayList<>(this.indexEntries.size());
            this.indexEntries.forEach(entry -> {
                if (entry.isDataEntry()) {
                    result.add(new MergedIndexEntry(entry.getStreamSegmentOffset() + offsetAdjustment, this.metadata.getId(), (CacheIndexEntry) entry));
                }
            });

            return result;
        }
    }
1007081
def offset(self, n):
        

        idx = self.index
        if idx is not None:
            sibling = idx + n
            container = self.container
            if 0 <= sibling < len(container):
                return container[sibling]
1092297
def next(self):
    
    while True:
      if not hasattr(self, "_cur_handle") or self._cur_handle is None:
        # If there are no more files, StopIteration is raised here
        self._cur_handle = super(GCSRecordInputReader, self).next()
      if not hasattr(self, "_record_reader") or self._record_reader is None:
        self._record_reader = records.RecordsReader(self._cur_handle)

      try:
        start_time = time.time()
        content = self._record_reader.read()
        self._slice_ctx.incr(self.COUNTER_IO_READ_BYTE, len(content))
        self._slice_ctx.incr(self.COUNTER_IO_READ_MSEC,
                             int(time.time() - start_time) * 1000)
        return content
      except EOFError:
        self._cur_handle = None
        self._record_reader = None
1253169
def get_neighbors(distance_matrix, source, eps):
    

    return [dest for dest, distance in enumerate(distance_matrix[source]) if distance < eps]
1202021
def get_extra(descriptor):
    
    result = []
    extra_length = descriptor.extra_length
    if extra_length:
        extra = buffer_at(descriptor.extra.value, extra_length)
        append = result.append
        while extra:
            length = _string_item_to_int(extra[0])
            if not 0 < length <= len(extra):
                raise ValueError(
                    'Extra descriptor %i is incomplete/invalid' % (
                        len(result),
                    ),
                )
            append(extra[:length])
            extra = extra[length:]
    return result
786709
def read_value(self, offset=0):
        
        try:
            val = self._object.ReadValue(
                {'offset': dbus.UInt16(offset, variant_level=1)},
                dbus_interface='org.bluez.GattDescriptor1')
            return val
        except dbus.exceptions.DBusException as e:
            error = _error_from_dbus_error(e)
            self.service.device.descriptor_read_value_failed(self, error=error)
174652
def with_descriptor(self, descriptor):
        '''
        
        '''
        res = {}
        desc = "%s_descriptor" % descriptor
        for eid, ent in self.items():
            if desc in ent:
                res[eid] = ent
        return res
645830
def DeserializeFromBufer(buffer, offset=0):
        
        mstream = StreamManager.GetStream(buffer)
        reader = BinaryReader(mstream)
        tx = Transaction.DeserializeFrom(reader)

        StreamManager.ReleaseStream(mstream)
        return tx
962935
def get_offset(cls, info):
        

        assert info.layer == 3

        if info.version == 1:
            if info.mode != 3:
                return 36
            else:
                return 21
        else:
            if info.mode != 3:
                return 21
            else:
                return 13
698249
def _get_next_positional(self):
        
        active_parser = self.active_parsers[-1]
        last_positional = self.visited_positionals[-1]

        all_positionals = active_parser._get_positional_actions()
        if not all_positionals:
            return None

        if active_parser == last_positional:
            return all_positionals[0]

        i = 0
        for i in range(len(all_positionals)):
            if all_positionals[i] == last_positional:
                break

        if i + 1 < len(all_positionals):
            return all_positionals[i + 1]

        return None
995211
def _update_offsets(start_x, spacing, terminations, offsets, length):
    '''
    '''
    return (start_x + spacing[0] * terminations / 2.,
            offsets[1] + spacing[1] * 2. + length)