code: def test_with_metadata_response():
      from kafka.protocol.metadata import MetadataResponse_v5
  
      tc = MetadataResponse_v5(
          throttle_time_ms=0,
          brokers=[
              [0, "testhost0", 9092, "testrack0"],
              [1, "testhost1", 9092, "testrack1"],
          ],
          cluster_id="abcd",
          controller_id=0,
          topics=[
              [
                  0,
                  "testtopic1",
                  False,
                  [
                      [0, 0, 0, [0, 1], [0, 1], []],
                      [0, 1, 1, [1, 0], [1, 0], []],
                  ],
              ],
              [
                  0,
                  "other-test-topic",
                  True,
                  [
                      [0, 0, 0, [0, 1], [0, 1], []],
                  ],
              ],
          ],
      )
      tc.encode()  # Make sure this object encodes successfully
  
      obj = tc.to_object()
  
      assert obj["throttle_time_ms"] == 0
  
      assert len(obj["brokers"]) == 2
      assert obj["brokers"][0]["node_id"] == 0
      assert obj["brokers"][0]["host"] == "testhost0"
      assert obj["brokers"][0]["port"] == 9092
      assert obj["brokers"][0]["rack"] == "testrack0"
      assert obj["brokers"][1]["node_id"] == 1
      assert obj["brokers"][1]["host"] == "testhost1"
      assert obj["brokers"][1]["port"] == 9092
      assert obj["brokers"][1]["rack"] == "testrack1"
  
      assert obj["cluster_id"] == "abcd"
      assert obj["controller_id"] == 0
  
      assert len(obj["topics"]) == 2
      assert obj["topics"][0]["error_code"] == 0
      assert obj["topics"][0]["topic"] == "testtopic1"
      assert obj["topics"][0]["is_internal"] == False
      assert len(obj["topics"][0]["partitions"]) == 2
      assert obj["topics"][0]["partitions"][0]["error_code"] == 0
      assert obj["topics"][0]["partitions"][0]["partition"] == 0
      assert obj["topics"][0]["partitions"][0]["leader"] == 0
      assert obj["topics"][0]["partitions"][0]["replicas"] == [0, 1]
      assert obj["topics"][0]["partitions"][0]["isr"] == [0, 1]
      assert obj["topics"][0]["partitions"][0]["offline_replicas"] == []
      assert obj["topics"][0]["partitions"][1]["error_code"] == 0
      assert obj["topics"][0]["partitions"][1]["partition"] == 1
      assert obj["topics"][0]["partitions"][1]["leader"] == 1
      assert obj["topics"][0]["partitions"][1]["replicas"] == [1, 0]
      assert obj["topics"][0]["partitions"][1]["isr"] == [1, 0]
      assert obj["topics"][0]["partitions"][1]["offline_replicas"] == []
  
      assert obj["topics"][1]["error_code"] == 0
      assert obj["topics"][1]["topic"] == "other-test-topic"
      assert obj["topics"][1]["is_internal"] == True
      assert len(obj["topics"][1]["partitions"]) == 1
      assert obj["topics"][1]["partitions"][0]["error_code"] == 0
      assert obj["topics"][1]["partitions"][0]["partition"] == 0
      assert obj["topics"][1]["partitions"][0]["leader"] == 0
      assert obj["topics"][1]["partitions"][0]["replicas"] == [0, 1]
      assert obj["topics"][1]["partitions"][0]["isr"] == [0, 1]
      assert obj["topics"][1]["partitions"][0]["offline_replicas"] == []
  
      tc.encode()
  
file_path: kafka-python/test/test_object_conversion.py
imports: from kafka.protocol.admin import Request
  from kafka.protocol.admin import Response
  from kafka.protocol.types import Schema
  from kafka.protocol.types import Array
  from kafka.protocol.types import Int16
  from kafka.protocol.types import String
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_with_metadata_response() without return types