'Get the last offset for the given partitions. The last offset of a
partition is the offset of the upcoming message, i.e. the offset of the
last available message + 1.
This method does not change the current consumer position of the
partitions.
Note:
This method may block indefinitely if the partition does not exist.
Arguments:
partitions (list): List of TopicPartition instances to fetch
offsets for.
Returns:
``{TopicPartition: int}``: The end offsets for the given partitions.
Raises:
UnsupportedVersionError: If the broker does not support looking
up the offsets by timestamp.
KafkaTimeoutError: If fetch failed in request_timeout_ms'

def end_offsets(self, partitions):

    if (self.config['api_version'] <= (0, 10, 0)):
        raise UnsupportedVersionError('offsets_for_times    API    not    supported    for    cluster    version    {}'.format(self.config['api_version']))
    offsets = self._fetcher.end_offsets(partitions, self.config['request_timeout_ms'])
    return offsets
