Step the current date forward +step+ days at a time (or backward, if +step+ is
 negative) until we reach +limit+ (inclusive), yielding the resultant date at each step.
970833
def step limit, step=1
      return to_enum(:step, limit, step) unless block_given?

      date = self
      comp_op = %w(== <= >=)[step <=> 0]
      while date.send comp_op, limit
        yield date
        date += step
      end
      self
    end
606758
def add_business_days(date, delta)
      date = roll_forward(date)
      delta.times do
        begin
          date += day_interval_for(date)
        end until business_day?(date)
      end
      date
    end
341022
public void prevStep() {
        if (currentStepIndex > 0) {
            Widget w = getWidget(currentStepIndex);
            if (w instanceof MaterialStep) {
                MaterialStep step = (MaterialStep) w;
                step.setActive(false);

                // prev step
                int prevStepIndex = getWidgetIndex(step) - 1;
                if (prevStepIndex >= 0) {
                    for (int i = prevStepIndex; i >= 0; i--) {
                        w = getWidget(i);
                        if (!(w instanceof MaterialStep)) {
                            continue;
                        }
                        MaterialStep prevStep = (MaterialStep) w;
                        if (prevStep.isEnabled() && prevStep.isVisible()) {
                            prevStep.setActive(true);
                            setCurrentStepIndex(i);
                            PreviousEvent.fire(MaterialStepper.this);
                            break;
                        }
                    }
                }
            }
        } else {
            GWT.log("You have reached the minimum step.");
        }
    }
1173600
def step(weights, duration):
    

    dt = duration / len(weights)

    def activate(t, dt):
        """This function returns 1 if t is in [0, dt[ and 0 otherwise.

        :param float t: current time
        :param float dt: time step
        """
        return 0 <= t < dt

    return (lambda t: sum([w * activate(t - i * dt, dt) for i, w in enumerate(weights)]))
399526
function progress( $step )
    {
        $totalSteps = 0;
        foreach ( $this->StepTable as $tableStep )
        {
            if ( !isset( $tableStep['count_step'] ) or
                 $tableStep['count_step'] )
                ++$totalSteps;
        }

        $currentStep = 0;
        foreach ( $this->StepTable as $key => $tableStep )
        {
            if ( $step['class'] == $tableStep['class'] )
            {
                break;
            }
            else if ( !isset( $tableStep['count_step'] ) or
                      $tableStep['count_step'] )
                ++$currentStep;
        }

        return (int) ( $currentStep * 100 / ( $totalSteps - 1 ) );
    }
1370406
@SuppressWarnings("unchecked")
    private Comparable increment(Object value, Number step) {
        return (Comparable) plus((Number) value, step);
    }
1186620
private int getPreviousStep(int currentStep) {
        int prevStep = -1;

        // we find the next available step.
        for (int i = currentStep - 1; i >= STEP_LOGIN; i--) {
            if(isStepEnabled(i)) {
                prevStep = i;
                break;
            }
        }

        return prevStep;
    }
659132
private void doStep(boolean forward) {

        // increment or decrement sequence
        if(forward)
            sequenceIndex++;
        else
            sequenceIndex--;

        // check sequence bounds; rollover if needed
        if(sequenceIndex >= stepSequence.length)
            sequenceIndex = 0;
        else if(sequenceIndex < 0)
            sequenceIndex = (stepSequence.length - 1);

        // start cycling GPIO pins to move the motor forward or reverse
        for(int pinIndex = 0; pinIndex < pins.length; pinIndex++) {
            // apply step sequence
            double nib = Math.pow(2, pinIndex);
            if((stepSequence[sequenceIndex] & (int)nib) > 0)
                pins[pinIndex].setState(onState);
            else
                pins[pinIndex].setState(offState);
        }
        try {
            Thread.sleep(stepIntervalMilliseconds, stepIntervalNanoseconds);
        }
        catch (InterruptedException e) {}
    }
674386
public void advanceTo(DateValue dateUtc) {
        // Don't throw away a future pending date since the iterators will not
        // generate it again.
        if (this.pendingUtc_ != null && dateUtc.compareTo(this.pendingUtc_) <= 0) {
            return;
        }

        DateValue dateLocal = TimeUtils.fromUtc(dateUtc, tzid_);
        // Short-circuit if we're already past dateUtc.
        if (dateLocal.compareTo(this.builder_.toDate()) <= 0) {
            return;
        }
        this.pendingUtc_ = null;

        try {
            if (this.canShortcutAdvance_) {
                // skip years before date.year
                if (this.builder_.year < dateLocal.year()) {
                    do {
                        if (!this.yearGenerator_.generate(this.builder_)) {
                            this.done_ = true;
                            return;
                        }
                    } while (this.builder_.year < dateLocal.year());
                    while (!this.monthGenerator_.generate(this.builder_)) {
                        if (!this.yearGenerator_.generate(this.builder_)) {
                            this.done_ = true;
                            return;
                        }
                    }
                }
                // skip months before date.year/date.month
                while (this.builder_.year == dateLocal.year()
                        && this.builder_.month < dateLocal.month()) {
                    while (!this.monthGenerator_.generate(this.builder_)) {
                        // if there are more years available fetch one
                        if (!this.yearGenerator_.generate(this.builder_)) {
                            // otherwise the recurrence is exhausted
                            this.done_ = true;
                            return;
                        }
                    }
                }
            }

            // consume any remaining instances
            while (!this.done_) {
                DateValue dUtc = this.generateInstance();
                if (null == dUtc) {
                    this.done_ = true;
                } else {
                    if (!this.condition_.apply(dUtc)) {
                        this.done_ = true;
                    } else if (dUtc.compareTo(dateUtc) >= 0) {
                        this.pendingUtc_ = dUtc;
                        break;
                    }
                }
            }
        } catch (Generator.IteratorShortCircuitingException ex) {
            this.done_ = true;
        }
    }
222614
def step(limit, step = 1)
      if block_given?
        super {|dt| yield dt.clear_timezone_offset }
      else
        enum = super
        enum.each {|dt| dt.clear_timezone_offset }
        enum
      end
    end
612314
def follow_comparison( steps, past_steps, attribute )
      operator = steps[0]
      value = steps[1..-1]
      value = value[0] if value.length == 1

      add_obligation_condition_for( past_steps, [attribute, operator, value] )
    end
218598
def frange(start, end, step):
    
    val = start
    while val < end:
        yield val
        val += step
496797
def ttl(self, steps, relative_time=None):
    '''
    
    '''
    if steps:
      # Approximate the ttl based on number of seconds, since it's
      # "close enough"
      if relative_time:
        rtime = self.to_bucket(relative_time)
        ntime = self.to_bucket(time.time())

        # Convert to number of days
        day_diff = (self.from_bucket(ntime, native=True) - self.from_bucket(rtime, native=True)).days
        # Convert steps to number of days as well
        step_diff = (steps*SIMPLE_TIMES[self._step[0]]) / SIMPLE_TIMES['d']

        # The relative time is beyond our TTL cutoff
        if day_diff > step_diff:
          return 0
        # The relative time is in "recent" past or future
        else:
          return (step_diff - day_diff) * SIMPLE_TIMES['d']
      return steps * SIMPLE_TIMES[ self._step[0] ]

    return None
43004
def rollforward(self, date):
        """"""
        if self.onOffset(date):
            return date
        else:
            return date + YearEnd(month=self.month)
608553
private void dcstep() {
		double sgnd = gp*Math.signum(gx);

		// the new step
		double stpf;

		if( fp > fx ) {
			stpf = handleCase1();
		} else if( sgnd < 0 ) {
			stpf = handleCase2();
		} else if( Math.abs(gp) < Math.abs(gx) ) {
			stpf = handleCase3();
		} else {
			stpf = handleCase4();
		}

		// update the bracket which contains the solution
		if( fp > fx ) {
			// found an upper bound
			sty = stp;
			fy = fp;
			gy = gp;
		} else {
			// see if its on the other side of the dip
			if( sgnd < 0 ) {
				sty = stx;
				fy = fx;
				gy = gx;
			}
			stx = stp;
			fx = fp;
			gx = gp;
		}
		
		stp = stpf;
		updated = true;
	}
382282
def step(self):
        # type: () -> bool
        
        with self.__lock:
            self.__value -= 1
            if self.__value == 0:
                # All done
                self.__event.set()
                return True
            elif self.__value < 0:
                # Gone too far
                raise ValueError("The counter has gone below 0")

        return False
722980
@SuppressWarnings("unchecked")
    private Comparable decrement(Object value, Number step) {
        return (Comparable) minus((Number) value, step);
    }