code: def test__reset_offset(fetcher, mocker):
      tp = TopicPartition("topic", 0)
      fetcher._subscriptions.subscribe(topics="topic")
      fetcher._subscriptions.assign_from_subscribed([tp])
      fetcher._subscriptions.need_offset_reset(tp)
      mocked = mocker.patch.object(fetcher, "_retrieve_offsets")
  
      mocked.return_value = {tp: (1001, None)}
      fetcher._reset_offset(tp)
      assert not fetcher._subscriptions.assignment[tp].awaiting_reset
      assert fetcher._subscriptions.assignment[tp].position == 1001
  
imports: from __future__ import absolute_import
  import pytest
  from collections import OrderedDict
  import itertools
  import time
  from kafka.client_async import KafkaClient
  from kafka.consumer.fetcher import CompletedFetch, ConsumerRecord, Fetcher, NoOffsetForPartitionError
  from kafka.consumer.subscription_state import SubscriptionState
  from kafka.future import Future
  from kafka.metrics import Metrics
  from kafka.protocol.fetch import FetchRequest, FetchResponse
  from kafka.protocol.offset import OffsetResponse
  from kafka.errors import StaleMetadata, LeaderNotAvailableError, NotLeaderForPartitionError, UnknownTopicOrPartitionError, OffsetOutOfRangeError
  from kafka.record.memory_records import MemoryRecordsBuilder, MemoryRecords
  from kafka.structs import OffsetAndMetadata, TopicPartition
label_desc: Use image node_id 9 for calling a global function with example usage: test__reset_offset(fetcher, mocker) without return types