code: def beginning_or_end_offset(self, partitions, timestamp, timeout_ms):
      timestamps = dict([(tp, timestamp) for tp in partitions])
      offsets = self._retrieve_offsets(timestamps, timeout_ms)
      for tp in timestamps:
          offsets[tp] = offsets[tp][0]
      return offsets
  
imports: from __future__ import absolute_import
  import collections
  import copy
  import logging
  import random
  import sys
  import time
  from kafka.vendor import six
  import kafka.errors
  from kafka.future import Future
  from kafka.metrics.stats import Avg, Count, Max, Rate
  from kafka.protocol.fetch import FetchRequest
  from kafka.protocol.offset import OffsetRequest, OffsetResetStrategy, UNKNOWN_OFFSET
  from kafka.record import MemoryRecords
  from kafka.serializer import Deserializer
  from kafka.structs import TopicPartition, OffsetAndTimestamp
label_desc: Use image node_id 10 for calling the Fetcher obj's underlying member method code with example usage: obj.beginning_or_end_offset(partitions, timestamp, timeout_ms) and returns: offsets