Finds the maximal value in timeseries.

@param series The timeseries.
@return The max value.
336385
public double max(double[] series) {
    double max = Double.MIN_VALUE;
    for (int i = 0; i < series.length; i++) {
      if (max < series[i]) {
        max = series[i];
      }
    }
    return max;
  }
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;
	}
602603
public boolean getExclusiveMax() {
        if (property instanceof AbstractNumericProperty) {
            AbstractNumericProperty numericProperty = (AbstractNumericProperty) property;
            return BooleanUtils.isTrue((numericProperty.getExclusiveMaximum()));
        }
        return false;
    }
367867
public double median(double[] series) {
    double[] clonedSeries = series.clone();
    Arrays.sort(clonedSeries);

    double median;
    if (clonedSeries.length % 2 == 0) {
      median = (clonedSeries[clonedSeries.length / 2]
          + (double) clonedSeries[clonedSeries.length / 2 - 1]) / 2;
    }
    else {
      median = clonedSeries[clonedSeries.length / 2];
    }
    return median;
  }
1356743
public Result<Series> createSeries(Series series) {
    checkNotNull(series);

    URI uri = null;
    try {
      URIBuilder builder = new URIBuilder(String.format("/%s/series/", API_VERSION));
      uri = builder.build();
    } catch (URISyntaxException e) {
      String message = "Could not build URI";
      throw new IllegalArgumentException(message, e);
    }

    Result<Series> result = null;
    String body = null;
    try {
      body = Json.dumps(series);
    } catch (JsonProcessingException e) {
      String message = "Error serializing the body of the request. More detail: " + e.getMessage();
      result = new Result<Series>(null, GENERIC_ERROR_CODE, message);
      return result;
    }

    HttpRequest request = buildRequest(uri.toString(), HttpMethod.POST, body);
    result = execute(request, Series.class);
    return result;
  }
456201
public <T extends Comparable<T>> Stream<TrieNode> max(Function<TrieNode, T> fn, int maxResults) {
    return max(fn, maxResults, root());
  }
1243707
def min_rank(series, ascending=True):
    

    ranks = series.rank(method='min', ascending=ascending)
    return ranks
267020
public static long maximum(long... values)
    {
        int len = values.length;
        long current = values[0];

        for (int i=1; i < len; i++)
        {
            current = Math.max(values[i], current);
        }

        return current;
    }
683906
public double getMax() {
        double max = s.minValue();
        for (int c = 0; c < this.values.length; c++) {
            if (s.gte(values[c], max)) {
                max = values[c];
            }
        }
        return max;
    }
613642
@Override
    public double max(TimeUnit unit) {
        return TimeUtils.convert(max.poll(), TimeUnit.MILLISECONDS, unit);
    }
40107
private long findMaxTimestamp() {
        if (!isInit) {
            init();
        }
        long max = 0;
        for (int i = 0; i < allNodes.length; i++) {
            if (allNodes[i] != null && allNodes[i].getLastTimestamp() > max) {
                max = allNodes[i].getLastTimestamp();
            }
        }
        return max;
    }
579718
public T max() {
        if (sum == 0)
            return null;
        int maxCount = -1;
        int maxIndex = -1;
        for (TIntIntIterator it = indexToCount.iterator(); it.hasNext(); ) {
            it.advance();
            if (it.value() > maxCount) {
                maxIndex = it.key();
                maxCount = it.value();
            }
        }
        return objectIndices.lookup(maxIndex);
    }
660250
protected int max(int[] v)
	{
		int x = 0;
		for (int i : v)
		{
			if (i > x) x = i;
		}
		return x;
	}
714853
public static int getMaxValueIndex (int[] values)
    {
        if (values == null || values.length == 0) {
            return -1;
        }

        int idx = 0;
        int max = values[idx];
        for (int ii = 1; ii < values.length; ii++) {
            if (values[ii] > max) {
                max = values[ii];
                idx = ii;
            }
        }
        return idx;
    }
1196325
public int maxValue()
    {
        final int initialValue = this.initialValue;
        int max = size == 0 ? initialValue : Integer.MIN_VALUE;

        final int[] entries = this.entries;
        @DoNotSub final int length = entries.length;

        for (@DoNotSub int i = 1; i < length; i += 2)
        {
            final int value = entries[i];
            if (value != initialValue)
            {
                max = Math.max(max, value);
            }
        }

        return max;
    }
391050
@Pure
	public static double max(double... values) {
		if (values == null || values.length == 0) {
			return Double.NaN;
		}
		double max = values[0];
		for (final double v : values) {
			if (v > max) {
				max = v;
			}
		}
		return max;
	}
581348
def bestExponent(self, seriesLenght):
        '''
        
        '''
        i = 0
        cont = True
        while(cont):
            if(int(seriesLenght/int(math.pow(2, i))) <= 1):
                cont = False
            else:
                i += 1
        return int(i-1)