Gets the initial offset for processing the partition.

        :rtype: str
422256
async def get_initial_offset_async(self): # throws InterruptedException, ExecutionException
        
        _logger.info("Calling user-provided initial offset provider %r %r",
                     self.host.guid, self.partition_id)
        starting_checkpoint = await self.host.storage_manager.get_checkpoint_async(self.partition_id)
        if not starting_checkpoint:
            # No checkpoint was ever stored. Use the initialOffsetProvider instead
            # defaults to "-1"
            self.offset = self.host.eph_options.initial_offset_provider
            self.sequence_number = -1
        else:
            self.offset = starting_checkpoint.offset
            self.sequence_number = starting_checkpoint.sequence_number

        _logger.info("%r %r Initial offset/sequenceNumber provided %r/%r",
                     self.host.guid, self.partition_id, self.offset, self.sequence_number)
        return self.offset
929808
def build_new_offsets(cls, client, topics_offset_data, topic_partitions, current_offsets):
        
        new_offsets = defaultdict(dict)
        try:
            for topic, partitions in six.iteritems(topic_partitions):
                # Validate current offsets in range of low and highmarks
                # Currently we only validate for positive offsets and warn
                # if out of range of low and highmarks
                valid_partitions = set()
                for topic_partition_offsets in current_offsets[topic]:
                    partition = topic_partition_offsets.partition
                    valid_partitions.add(partition)
                    # Skip the partition not present in list
                    if partition not in topic_partitions[topic]:
                        continue
                    lowmark = topic_partition_offsets.lowmark
                    highmark = topic_partition_offsets.highmark
                    new_offset = topics_offset_data[topic][partition]
                    if new_offset < 0:
                        print(
                            "Error: Given offset: {offset} is negative"
                            .format(offset=new_offset),
                            file=sys.stderr,
                        )
                        sys.exit(1)
                    if new_offset < lowmark or new_offset > highmark:
                        print(
                            "Warning: Given offset {offset} for topic-partition "
                            "{topic}:{partition} is outside the range of lowmark "
                            "{lowmark} and highmark {highmark}".format(
                                offset=new_offset,
                                topic=topic,
                                partition=partition,
                                lowmark=lowmark,
                                highmark=highmark,
                            )
                        )
                    new_offsets[topic][partition] = new_offset
                if not set(partitions).issubset(valid_partitions):
                    print(
                        "Error: Some invalid partitions {partitions} for topic "
                        "{topic} found. Valid partition-list {valid_partitions}. "
                        "Exiting...".format(
                            partitions=', '.join([str(p) for p in partitions]),
                            valid_partitions=', '.join([str(p) for p in valid_partitions]),
                            topic=topic,
                        ),
                        file=sys.stderr,
                    )
                    sys.exit(1)
        except KeyError as ex:
            print(
                "Error: Possible invalid topic or partition. Error msg: {ex}. "
                "Exiting...".format(ex=ex),
            )
            sys.exit(1)
        return new_offsets
27903
def GetCacheSize(self):
    
    if not self._cache_start_offset or not self._cache_end_offset:
      return 0
    return self._cache_end_offset - self._cache_start_offset
974447
def binsearch_offset(reader, key, compare_func=cmp, block_size=8192):
    
    min_ = 0

    reader.seek(0, 2)
    max_ = int(reader.tell() / block_size)

    while max_ - min_ > 1:
        mid = int(min_ + ((max_ - min_) / 2))
        reader.seek(mid * block_size)

        if mid > 0:
            reader.readline()  # skip partial line

        line = reader.readline()

        if compare_func(key, line) > 0:
            min_ = mid
        else:
            max_ = mid

    return min_ * block_size
711226
def get_start_of_line_position(self, after_whitespace=False):
        
        if after_whitespace:
            current_line = self.current_line
            return len(current_line) - len(current_line.lstrip()) - self.cursor_position_col
        else:
            return - len(self.current_line_before_cursor)
898721
def get_offset(self):
        """"""
        return self.p1.y-self.get_slope()*self.p1.x
1266756
def offset(self, offset_value):
        

        new_instance = deepcopy(self)
        new_instance.poly_funct.coef[0] += offset_value
        return new_instance
225950
def align_after(self, offset):
        
        f = self.reader
        if offset <= 0:  # FIXME what is a negative offset??
            f.seek(0)
            self._block_count = 0
            self._read_header()  # FIXME we can't extimate how big it is...
            return
        sm = self.sync_marker
        sml = len(sm)
        pos = offset
        while pos < self.file_length - sml:
            f.seek(pos)
            data = f.read(self.FORWARD_WINDOW_SIZE)
            sync_offset = data.find(sm)
            if sync_offset > -1:
                f.seek(pos + sync_offset)
                self._block_count = 0
                return
            pos += len(data)
1215286
def horz_offset(self):
        
        x, xMode = self.x, self.xMode
        if x is None or xMode is None or xMode.val != ST_LayoutMode.FACTOR:
            return 0.0
        return x.val
537008
def update_offset(self, offset):
        # type: (int) -> None
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('CE record not yet initialized!')

        self.offset_cont_area = offset
719197
def first(self):
        

        if self.total and self.limit < self.total:
            return {'page[offset]': 0, 'page[limit]': self.limit}
        else:
            return None
952514
def get_init(self):
        
        suffix = self._separator + "%s" % str(self._counter_init)

        return self._base_name + suffix
106387
def bottomAt(self, offset=0):
        
        return Location(self.getX() + (self.getW() / 2), self.getY() + self.getH() + offset)
542977
def merge_partition_offsets(*partition_offsets):
    
    output = dict()
    for partition_offset in partition_offsets:
        for partition, offset in six.iteritems(partition_offset):
            prev_offset = output.get(partition, 0)
            output[partition] = max(prev_offset, offset)
    return output
1335050
def next_offsets(self):
        # type: (Descriptor) -> Offsets
        
        resume_bytes = self._resume()
        with self._meta_lock:
            if self._chunk_num >= self._total_chunks:
                return None, resume_bytes
            if self._chunk_size == -1 and self._src_block_list is not None:
                num_bytes = self._src_block_list[self._chunk_num].size
            else:
                if self._offset + self._chunk_size > self._src_ase.size:
                    num_bytes = self._src_ase.size - self._offset
                else:
                    num_bytes = self._chunk_size
            chunk_num = self._chunk_num
            range_start = self._offset
            range_end = self._offset + num_bytes - 1
            self._offset += num_bytes
            self._chunk_num += 1
            return Offsets(
                chunk_num=chunk_num,
                num_bytes=num_bytes,
                range_start=range_start,
                range_end=range_end,
            ), resume_bytes
301029
def read_to_offset(self, offset):
    
    assert offset >= self._offset
    result = self._buffer[self._offset: offset]
    self._offset += len(result)
    return result
674605
def reset_offsets_if_needed(self, partitions):
        
        for tp in partitions:
            # TODO: If there are several offsets to reset, we could submit offset requests in parallel
            if self._subscriptions.is_assigned(tp) and self._subscriptions.is_offset_reset_needed(tp):
                self._reset_offset(tp)