code: def decode_metadata_response(cls, data):
          
          ((correlation_id, numbrokers), cur) = relative_unpack('>ii', data, 0)
  
          # In testing, I saw this routine swap my machine to death when
          # passed bad data. So, some checks are in order...
          if numbrokers > MAX_BROKERS:
              raise InvalidMessageError(
                  "Brokers:{} exceeds max:{}".format(numbrokers, MAX_BROKERS))
  
          # Broker info
          brokers = {}
          for _i in range(numbrokers):
              ((nodeId, ), cur) = relative_unpack('>i', data, cur)
              (host, cur) = read_short_ascii(data, cur)
              ((port,), cur) = relative_unpack('>i', data, cur)
              brokers[nodeId] = BrokerMetadata(nodeId, nativeString(host), port)
  
          # Topic info
          ((num_topics,), cur) = relative_unpack('>i', data, cur)
          topic_metadata = {}
  
          for _i in range(num_topics):
              ((topic_error,), cur) = relative_unpack('>h', data, cur)
              (topic_name, cur) = read_short_ascii(data, cur)
              ((num_partitions,), cur) = relative_unpack('>i', data, cur)
              partition_metadata = {}
  
              for _j in range(num_partitions):
                  ((partition_error_code, partition, leader, numReplicas),
                   cur) = relative_unpack('>hiii', data, cur)
  
                  (replicas, cur) = relative_unpack(
                      '>%di' % numReplicas, data, cur)
  
                  ((num_isr,), cur) = relative_unpack('>i', data, cur)
                  (isr, cur) = relative_unpack('>%di' % num_isr, data, cur)
  
                  partition_metadata[partition] = \
                      PartitionMetadata(
                          topic_name, partition, partition_error_code, leader,
                          replicas, isr)
  
              topic_metadata[topic_name] = TopicMetadata(
                  topic_name, topic_error, partition_metadata)
  
          return brokers, topic_metadata
docs: Decode bytes to a MetadataResponse
  
          :param bytes data: bytes to decode