code: def _get_target_brokers(self, over_loaded_brokers, under_loaded_brokers, sibling_distance):
          
          # Sort given brokers to ensure determinism
          over_loaded_brokers = sorted(
              over_loaded_brokers,
              key=lambda b: len(b.partitions),
              reverse=True,
          )
          under_loaded_brokers = sorted(
              under_loaded_brokers,
              key=lambda b: len(b.partitions),
          )
          # pick pair of brokers from source and destination brokers with
          # minimum same-partition-count
          # Set result in format: (source, dest, preferred-partition)
          target = (None, None, None)
          min_distance = sys.maxsize
          best_partition = None
          for source in over_loaded_brokers:
              for dest in under_loaded_brokers:
                  # A decommissioned broker can have less partitions than
                  # destination. We consider it a valid source because we want to
                  # move all the partitions out from it.
                  if (len(source.partitions) - len(dest.partitions) > 1 or
                          source.decommissioned):
                      best_partition = source.get_preferred_partition(
                          dest,
                          sibling_distance[dest][source],
                      )
                      # If no eligible partition continue with next broker.
                      if best_partition is None:
                          continue
                      distance = sibling_distance[dest][source][best_partition.topic]
                      if distance < min_distance:
                          min_distance = distance
                          target = (source, dest, best_partition)
                  else:
                      # If relatively-unbalanced then all brokers in destination
                      # will be thereafter, return from here.
                      break
          return target
docs: Pick best-suitable source-broker, destination-broker and partition to
          balance partition-count over brokers in given replication-group.