code: def _elect_dest_replication_group(
              self,
              replica_count_source,
              under_replicated_rgs,
              partition,
      ):
          
          min_replicated_rg = min(
              under_replicated_rgs,
              key=lambda rg: rg.count_replica(partition),
          )
          # Locate under-replicated replication-group with lesser
          # replica count than source replication-group
          if min_replicated_rg.count_replica(partition) < replica_count_source - 1:
              return min_replicated_rg
          return None
docs: Decide destination replication-group based on replica-count.