code: func (s *ServiceAntiAffinity) CalculateAntiAffinityPriorityReduce(pod *v1.Pod, meta interface{}, nodeNameToInfo map[string]*schedulernodeinfo.NodeInfo, result schedulerapi.HostPriorityList) error {
  	var numServicePods int
  	var label string
  	podCounts := map[string]int{}
  	labelNodesStatus := map[string]string{}
  	maxPriorityFloat64 := float64(schedulerapi.MaxPriority)
  
  	for _, hostPriority := range result {
  		numServicePods += hostPriority.Score
  		if !labels.Set(nodeNameToInfo[hostPriority.Host].Node().Labels).Has(s.label) {
  			continue
  		}
  		label = labels.Set(nodeNameToInfo[hostPriority.Host].Node().Labels).Get(s.label)
  		labelNodesStatus[hostPriority.Host] = label
  		podCounts[label] += hostPriority.Score
  	}
  
  	//score int - scale of 0-maxPriority
  	// 0 being the lowest priority and maxPriority being the highest
  	for i, hostPriority := range result {
  		label, ok := labelNodesStatus[hostPriority.Host]
  		if !ok {
  			result[i].Host = hostPriority.Host
  			result[i].Score = int(0)
  			continue
  		}
  		// initializing to the default/max node score of maxPriority
  		fScore := maxPriorityFloat64
  		if numServicePods > 0 {
  			fScore = maxPriorityFloat64 * (float64(numServicePods-podCounts[label]) / float64(numServicePods))
  		}
  		result[i].Host = hostPriority.Host
  		result[i].Score = int(fScore)
  	}
  
  	return nil
  }
docs: // CalculateAntiAffinityPriorityReduce computes each node score with the same value for a particular label.
  // The label to be considered is provided to the struct (ServiceAntiAffinity).