docstr: Lookup and set offsets for any partitions which are awaiting an
  explicit reset.
  
  Arguments:
      partitions (set of TopicPartitions): the partitions to reset
code: def reset_offsets_if_needed(self, partitions):
      """Lookup and set offsets for any partitions which are awaiting an
      explicit reset.
  
      Arguments:
          partitions (set of TopicPartitions): the partitions to reset
      """
      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)
  
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 3 for calling the Fetcher obj's underlying member method code with example usage: obj.reset_offsets_if_needed(partitions) without return types