Calculates the maximum count of events that exist in both arrays.
558291
def get_max_events_in_both_arrays(events_one, events_two):
    
    events_one = np.ascontiguousarray(events_one)  # change memory alignement for c++ library
    events_two = np.ascontiguousarray(events_two)  # change memory alignement for c++ library
    event_result = np.empty(shape=(events_one.shape[0] + events_two.shape[0], ), dtype=events_one.dtype)
    count = analysis_functions.get_max_events_in_both_arrays(events_one, events_two, event_result)
    return event_result[:count]
1221727
private double[] findMinMaxWithErrorBars(double[] data, double[] errorBars) {

    double min = Double.MAX_VALUE;
    double max = -Double.MAX_VALUE;

    for (int i = 0; i < data.length; i++) {

      double d = data[i];
      double eb = errorBars[i];
      if (d - eb < min) {
        min = d - eb;
      }
      if (d + eb > max) {
        max = d + eb;
      }
    }
    return new double[] {min, max};
  }
590787
def _counts(self):
        

        rolling_dim = utils.get_temp_dimname(self.obj.dims, '_rolling_dim')
        # We use False as the fill_value instead of np.nan, since boolean
        # array is faster to be reduced than object array.
        # The use of skipna==False is also faster since it does not need to
        # copy the strided array.
        counts = (self.obj.notnull()
                  .rolling(center=self.center, **{self.dim: self.window})
                  .construct(rolling_dim, fill_value=False)
                  .sum(dim=rolling_dim, skipna=False))
        return counts
131578
public static int max(int[] values)
    {
        int max = Integer.MIN_VALUE;

        for (int i = 0; i < values.length; ++i)
        {
            if (max < values[i])
            {
                max = values[i];
            }
        }

        return max;
    }
379142
private double[] max(double[] distances1, double[] distances2) {
    if(distances1.length != distances2.length) {
      throw new RuntimeException("different lengths!");
    }

    double[] result = new double[distances1.length];
    for(int i = 0; i < distances1.length; i++) {
      result[i] = Math.max(distances1[i], distances2[i]);
    }
    return result;
  }
243203
public void combine(LongSummaryStatistics other) {
        count += other.count;
        sum += other.sum;
        min = Math.min(min, other.min);
        max = Math.max(max, other.max);
    }
1287043
def best(self):
        
        b = (-1e999999, None)
        for k, c in iteritems(self.counts):
            b = max(b, (c, k))
        return b[1]
909273
public static int max(IntArrayND array)
    {
        return array.stream().parallel().reduce(
            Integer.MIN_VALUE, Math::max);
    }
185658
public static Map.Entry<Object, Object> maximumLikelihood(DataTable2D payoffMatrix, AssociativeArray eventProbabilities) {
        if(payoffMatrix.isValid()==false) {
            throw new IllegalArgumentException("The payoff matrix does not have a rectangular format.");
        }
        
        Map.Entry<Object, Object> eventEntry = MapMethods.selectMaxKeyValue(eventProbabilities);
        
        Object mostProbableEvent = eventEntry.getKey();
        //Double mostProbableEventProbability = Dataset.toDouble(eventEntry.getValue());
        
        return MapMethods.selectMaxKeyValue(payoffMatrix.get(mostProbableEvent));
    }
203174
def max_heapify(arr, end, simulation, iteration):
    
    last_parent = (end - 1) // 2

    # Iterate from last parent to first
    for parent in range(last_parent, -1, -1):
        current_parent = parent

        # Iterate from current_parent to last_parent
        while current_parent <= last_parent:
            # Find greatest child of current_parent
            child = 2 * current_parent + 1
            if child + 1 <= end and arr[child] < arr[child + 1]:
                child = child + 1

            # Swap if child is greater than parent
            if arr[child] > arr[current_parent]:
                arr[current_parent], arr[child] = arr[child], arr[current_parent]
                current_parent = child
                if simulation:
                    iteration = iteration + 1
                    print("iteration",iteration,":",*arr)
            # If no swap occured, no need to keep iterating
            else:
                break
    arr[0], arr[end] = arr[end], arr[0]
    return iteration
660250
protected int max(int[] v)
	{
		int x = 0;
		for (int i : v)
		{
			if (i > x) x = i;
		}
		return x;
	}
501386
@Pure
	public static int max(int... values) {
		if (values == null || values.length == 0) {
			return 0;
		}
		int max = values[0];
		for (final int v : values) {
			if (v > max) {
				max = v;
			}
		}
		return max;
	}
1183670
public static int maxInArray(int[] values)
    {
        if ((values == null) || (values.length == 0))
        {
            throw new IllegalArgumentException("Cannot find the max of a null or empty array.");
        }

        int max = values[0];

        for (int value : values)
        {
            max = (max < value) ? value : max;
        }

        return max;
    }
867885
public static INDArray max(INDArray first, INDArray second, boolean dup) {
        INDArray result = first;
        if (dup) {
            result = first.ulike();
        }
        return exec(new OldMax(first, second, result));
    }
147425
def total_events(treatment, event)
      experiment = treatment.experiment
      result = redis.hvals(event_key(experiment, treatment, event))
      result.map(&:to_i).reduce(&:+)
    end
1293695
public int getEventCount()
    {
        int count = _events.size();
        if (_superEventSet != null)
            count += _superEventSet.getEventCount();
        return count;
    }
95988
def count(self):
        
        return functools.reduce(lambda x, y: x * y, (x.count for x in self.bounds))