code: def test_fetched_records(fetcher, topic, mocker):
      fetcher.config["check_crcs"] = False
      tp = TopicPartition(topic, 0)
  
      msgs = []
      for i in range(10):
          msgs.append((None, b"foo", None))
      completed_fetch = CompletedFetch(
          tp,
          0,
          0,
          [0, 100, _build_record_batch(msgs)],
          mocker.MagicMock(),
      )
      fetcher._completed_fetches.append(completed_fetch)
      records, partial = fetcher.fetched_records()
      assert tp in records
      assert len(records[tp]) == len(msgs)
      assert all(
          map(lambda x: isinstance(x, ConsumerRecord), records[tp])
      )
      assert partial is False
  
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 13 for calling a global function with example usage: test_fetched_records(fetcher, topic, mocker) without return types