Returns an Interval starting from the value from to the specified value to with a step value of 1.
348475
public static Interval fromTo(int from, int to)
    {
        if (from <= to)
        {
            return Interval.fromToBy(from, to, 1);
        }
        return Interval.fromToBy(from, to, -1);
    }
294686
public static BigDecimal roundUpTo(double value, double steps) {
        final BigDecimal bValue = BigDecimal.valueOf(value);
        final BigDecimal bSteps = BigDecimal.valueOf(steps);

        if (Objects.equals(bSteps, BigDecimal.ZERO)) {
            return bValue;
        } else {
            return bValue.divide(bSteps, 0, RoundingMode.CEILING).multiply(bSteps);
        }
    }
1198399
function range (start, stop, step) {
  var index, len
  var result = []
  var args = arguments
  if (args.length < 2) {
    stop = args[0]
    start = 0
  }
  index = start >> 0
  len = stop >> 0
  if (index < stop) {
    step = step >> 0 || 1
    for (; index < len; index += step) {
      result.push(index)
    }
  }
  return result
}
695038
def transition(value, maximum, start, end):
    
    return round(start + (end - start) * value / maximum, 2)
1025100
function (value, from) {
    var len = this.length >>> 0;

    from = Number(from) || 0;
    from = Math[from < 0 ? 'ceil' : 'floor'](from);

    if (from < 0) {
      from = Math.max(from + len, 0);
    }

    for (; from < len; from++) {
      if (from in this && this[from] === value) {
        return from;
      }
    }

    return -1;
  }
880561
def value(self, t):
        """"""
        fraction = min(float(t) / max(1, self.schedule_timesteps), 1.0)
        return self.initial_p + fraction * (self.final_p - self.initial_p)
1244564
def next_interval(self, interval):
        
        index = np.where(self.intervals == interval)
        if index[0][0] + 1 < len(self.intervals):
            return self.intervals[index[0][0] + 1]
        else:
            raise IndexError("Ran out of intervals!")
1098951
ProgressEvent updateProgress(double val, long now) {
		if (val<0 || val>1) {
			throw new IllegalArgumentException("Value out of range [0, 1]: " + val);
		}
		if (val<=progress.getProgress()) {
			reset(start);
		}
		double pD = val - progress.getProgress();
		long tD = now - tstamp;
		if (step > 0) {
			step = step * 0.3 + (tD / pD) * 0.7; 
		} else {
			step = (tD / pD);
		}
		double etcMs = step * (1 - val);
		progress = new ProgressEvent(val, new Date(now + (long)Math.round(etcMs)));
		tstamp = now;
		return progress;
	}
1204898
private int getNextStep(int currentStep) {
        int nextStep = -1;
        
        // we find the next available step.
        for (int i = currentStep + 1; i <= STEP_THANKS; i++) {
            if(isStepEnabled(i)) {
                nextStep = i;
                break;
            }
        }

        return nextStep;
    }
733116
function range(begin, end, interval = 1) {
  var a = [];

  for (let i = begin; i < (begin+end); i += interval) {
    a.push(i);
  }

  return a;
}
1245288
def set_interval(self, start, end, value, compact=False):
        
        # for each interval to render
        for i, (s, e, v) in enumerate(self.iterperiods(start, end)):
            # look at all intervals included in the current interval
            # (always at least 1)
            if i == 0:
                # if the first, set initial value to new value of range
                self.set(s, value, compact)
            else:
                # otherwise, remove intermediate key
                del self[s]

        # finish by setting the end of the interval to the previous value
        self.set(end, v, compact)
74709
public static Interval evensFromTo(int from, int to)
    {
        if (from % 2 != 0)
        {
            if (from < to)
            {
                from++;
            }
            else
            {
                from--;
            }
        }
        if (to % 2 != 0)
        {
            if (to > from)
            {
                to--;
            }
            else
            {
                to++;
            }
        }
        return Interval.fromToBy(from, to, to > from ? 2 : -2);
    }
1209608
function (segment, step) {
      if (segment % step === 0) {
        return segment;
      }
      if (Math.round((segment % step) / step)) {
        return (segment + (step - segment % step)) % 60;
      } else {
        return segment - segment % step;
      }
    }
761061
function getStep ( xPct, xSteps, snap, value ) {

        if ( value === 100 ) {
            return value;
        }

        var j = getJ( value, xPct ), a, b;

        // If 'snap' is set, steps are used as fixed points on the slider.
        if ( snap ) {

            a = xPct[j-1];
            b = xPct[j];

            // Find the closest position, a or b.
            if ((value - a) > ((b-a)/2)){
                return b;
            }

            return a;
        }

        if ( !xSteps[j-1] ){
            return value;
        }

        return xPct[j-1] + closest(
                value - xPct[j-1],
                xSteps[j-1]
            );
    }
218598
def frange(start, end, step):
    
    val = start
    while val < end:
        yield val
        val += step
359505
def stepBy(self, steps):
        
        self.setValue(self.value() + steps*self.singleStep())
294549
def interval_diff(progression1, progression2, interval):
    """"""
    i = numeral_intervals[numerals.index(progression1)]
    j = numeral_intervals[numerals.index(progression2)]
    acc = 0
    if j < i:
        j += 12
    while j - i > interval:
        acc -= 1
        j -= 1
    while j - i < interval:
        acc += 1
        j += 1
    return acc