step 1b as defined for the porter stemmer algorithm.
181985
function step1b(token) {   
    if(token.substr(-3) == 'eed') {
	if(measure(token.substr(0, token.length - 3)) > 0)
            return token.replace(/eed$/, 'ee');
    } else {
	var result = attemptReplace(token, /ed|ing$/, '', function(token) {   
	    if(categorizeGroups(token).indexOf('V') > 0) {
		result = attemptReplacePatterns(token, [['at', 'ate'],  ['bl', 'ble'], ['iz', 'ize']]);

		if(result)
		    return result;
		else {
		    if(endsWithDoublCons(token) && token.match(/[^lsz]$/))
			return token.replace(/([^aeiou])\1$/, '$1');

		    if(measure(token) == 1 && categorizeChars(token).substr(-3) == 'CVC' && token.match(/[^wxy]$/))
			return token + 'e';                            
		}

		return token;
	    }
	    
	    return null;
	});
	
	if(result)
	    return result;
    }

    return token;   
}
80788
public void implicitDoubleStep( int x1 , int x2 ) {
        if( printHumps )
            System.out.println("Performing implicit double step");

         // compute the wilkinson shift
        double z11 = A.get(x2 - 1, x2 - 1);
        double z12 = A.get(x2 - 1, x2);
        double z21 = A.get(x2, x2 - 1);
        double z22 = A.get(x2, x2);

        double a11 = A.get(x1,x1);
        double a21 = A.get(x1+1,x1);
        double a12 = A.get(x1,x1+1);
        double a22 = A.get(x1+1,x1+1);
        double a32 = A.get(x1+2,x1+1);

        if( normalize ) {
            temp[0] = a11;temp[1] = a21;temp[2] = a12;temp[3] = a22;temp[4] = a32;
            temp[5] = z11;temp[6] = z22;temp[7] = z12;temp[8] = z21;

            double max = Math.abs(temp[0]);
            for( int j = 1; j < temp.length; j++ ) {
                if( Math.abs(temp[j]) > max )
                    max = Math.abs(temp[j]);
            }
            a11 /= max;a21 /= max;a12 /= max;a22 /= max;a32 /= max;
            z11 /= max;z22 /= max;z12 /= max;z21 /= max;
        }

        // these equations are derived when the eigenvalues are extracted from the lower right
        // 2 by 2 matrix.  See page 388 of Fundamentals of Matrix Computations 2nd ed for details.
        double b11,b21,b31;
        if( useStandardEq ) {
            b11 = ((a11- z11)*(a11- z22)- z21 * z12)/a21 + a12;
            b21 = a11 + a22 - z11 - z22;
            b31 = a32;
        } else {
            // this is different from the version in the book and seems in my testing to be more resilient to
            // over flow issues
            b11 = ((a11- z11)*(a11- z22)- z21 * z12) + a12*a21;
            b21 = (a11 + a22 - z11 - z22)*a21;
            b31 = a32*a21;
        }

        performImplicitDoubleStep(x1, x2, b11 , b21 , b31 );
    }
932270
def make_step(
    net,
    step_size = 1.5,
    end       = "inception_4c/output", 
    jitter    = 32,
    clip      = True,
    objective = objective_L2
    ):
    '''
    
    '''

    src = net.blobs["data"]
    dst = net.blobs[end]

    ox, oy = np.random.randint(- jitter, jitter + 1, 2)
    # Apply jitter shift.
    src.data[0] = np.roll(np.roll(src.data[0], ox, -1), oy, -2)

    # Specify the optimisation objective.
    net.forward(end = end)
    objective(dst)
    net.backward(start = end)
    g = src.diff[0]
    # Apply normalised ascent step to the input image.
    src.data[:] += step_size / np.abs(g).mean() * g
    # Unshift the image.
    src.data[0] = np.roll(np.roll(src.data[0], - ox, - 1), -oy, -2)
            
    if clip:
        bias = net.transformer.mean["data"]
        src.data[:] = np.clip(src.data, -bias, 255-bias)
810316
def step(self):
        """"""

        # If the nproc parameter of __init__ is zero, just iterate
        # over the K consensus instances instead of using
        # multiprocessing to do the computations in parallel. This is
        # useful for debugging and timing comparisons.
        if self.nproc == 0:
            for k in range(self.xstep.cri.K):
                step_group(k)
        else:
            self.pool.map(step_group, range(self.xstep.cri.K))

        ccmod_ystep()
        ccmod_ustep()
        cbpdn_setdict()
962704
def step1c(self):
        
        if self.ends(['y']) and self.vowel_in_stem():
            self.b[self.k] = 'i'
678871
def step(self, t, x_im1, v_im1_2, dt):
        

        x_i = x_im1 + v_im1_2 * dt
        F_i = self.F(t, np.vstack((x_i, v_im1_2)), *self._func_args)
        a_i = F_i[self.ndim:]

        v_i = v_im1_2 + a_i * dt / 2
        v_ip1_2 = v_i + a_i * dt / 2

        return x_i, v_i, v_ip1_2
435447
def steps(self, goal):
        

        path = self.path(goal)
        for i in range(len(path) - 1):
            yield path[i], path[i + 1]
116724
function step(equation, symbolName) {
  const solveFunctions = [
    // ensure the symbol is always on the left node
    EquationOperations.ensureSymbolInLeftNode,
    // get rid of denominators that have the symbol
    EquationOperations.removeSymbolFromDenominator,
    // remove the symbol from the right side
    EquationOperations.removeSymbolFromRightSide,
    // isolate the symbol on the left side
    EquationOperations.isolateSymbolOnLeftSide,
  ];

  for (let i = 0; i < solveFunctions.length; i++) {
    const equationStatus = solveFunctions[i](equation, symbolName);

    if (equationStatus.hasChanged()) {
      return equationStatus;
    }
  }
  return EquationStatus.noChange(equation);
}
1195010
function step1c(token) {
    if(categorizeGroups(token).substr(-2, 1) == 'V') {
        if(token.substr(-1) == 'y')
            return token.replace(/y$/, 'i');
    }
   
    return token;
}
1169828
function step1c(token) {
    var categorizedGroups = categorizeGroups(token);

    if(token.substr(-1) == 'y' && categorizedGroups.substr(0, categorizedGroups.length - 1).indexOf('V') > -1) {
        return token.replace(/y$/, 'i');
    }

    return token;
}
934968
def step4(self):
        """"""
        if self.b[self.k - 1] == 'a':
            if self.ends("al"): pass
            else: return
        elif self.b[self.k - 1] == 'c':
            if self.ends("ance"): pass
            elif self.ends("ence"): pass
            else: return
        elif self.b[self.k - 1] == 'e':
            if self.ends("er"): pass
            else: return
        elif self.b[self.k - 1] == 'i':
            if self.ends("ic"): pass
            else: return
        elif self.b[self.k - 1] == 'l':
            if self.ends("able"): pass
            elif self.ends("ible"): pass
            else: return
        elif self.b[self.k - 1] == 'n':
            if self.ends("ant"): pass
            elif self.ends("ement"): pass
            elif self.ends("ment"): pass
            elif self.ends("ent"): pass
            else: return
        elif self.b[self.k - 1] == 'o':
            if (self.ends("ion") and
                (self.b[self.j] == 's' or self.b[self.j] == 't')):
                pass
            elif self.ends("ou"):
                pass
            # takes care of -ous
            else:
                return
        elif self.b[self.k - 1] == 's':
            if self.ends("ism"): pass
            else: return
        elif self.b[self.k - 1] == 't':
            if self.ends("ate"): pass
            elif self.ends("iti"): pass
            else: return
        elif self.b[self.k - 1] == 'u':
            if self.ends("ous"): pass
            else: return
        elif self.b[self.k - 1] == 'v':
            if self.ends("ive"): pass
            else: return
        elif self.b[self.k - 1] == 'z':
            if self.ends("ize"): pass
            else: return
        else:
            return
        if self.m() > 1:
            self.k = self.j
671388
private final void step4() {
        switch (b[k]) {
            case 'e':
                if (endWith("icate")) {
                    r("ic");
                    break;
                }
                if (endWith("ative")) {
                    r("");
                    break;
                }
                if (endWith("alize")) {
                    r("al");
                    break;
                }
                break;
            case 'i':
                if (endWith("iciti")) {
                    r("ic");
                    break;
                }
                break;
            case 'l':
                if (endWith("ical")) {
                    r("ic");
                    break;
                }
                if (endWith("ful")) {
                    r("");
                    break;
                }
                break;
            case 's':
                if (endWith("ness")) {
                    r("");
                    break;
                }
                break;
        }
    }
355333
private function step1()
    {
        //  erte   ert
        //      replace with er
        if ( ($position = $this->searchIfInR1(array('erte', 'ert'))) !== false) {
            $this->word = preg_replace('#(erte|ert)$#u', 'er', $this->word);
            return true;
        }

         // a   e   ede   ande   ende   ane   ene   hetene   en   heten   ar   er   heter   as   es   edes   endes   enes   hetenes   ens   hetens   ers   ets   et   het   ast
        //      delete
        if ( ($position = $this->searchIfInR1(array(
            'hetenes', 'hetene', 'hetens', 'heten', 'endes', 'heter', 'ande', 'ende', 'enes', 'edes', 'ede', 'ane',
            'ene', 'het', 'ers', 'ets', 'ast', 'ens', 'en', 'ar', 'er', 'as', 'es', 'et', 'a', 'e'
        ))) !== false) {
            $this->word = Utf8::substr($this->word, 0, $position);
            return true;
        }

        //  s
        //      delete if preceded by a valid s-ending
        if ( ($position = $this->searchIfInR1(array('s'))) !== false) {
            $word = Utf8::substr($this->word, 0, $position);
            if ($this->hasValidSEnding($word)) {
                $this->word = $word;
            }
            return true;
        }
    }
241696
def ystep(self):
        

        super(ConvCnstrMODMaskDcpl_Consensus, self).ystep()
        AXU1 = self.AX1 + self.U1
        self.Y1 = self.rho*(AXU1 - self.S) / (self.W**2 + self.rho)
560983
function step(node) {
  let nodeStatus;

  node = flattenOperands(node);
  node = removeUnnecessaryParens(node, true);

  const simplificationTreeSearches = [
    // Basic simplifications that we always try first e.g. (...)^0 => 1
    basicsSearch,
    // Simplify any division chains so there's at most one division operation.
    // e.g. 2/x/6 -> 2/(x*6)        e.g. 2/(x/6) => 2 * 6/x
    divisionSearch,
    // Adding fractions, cancelling out things in fractions
    fractionsSearch,
    // e.g. 2 + 2 => 4
    arithmeticSearch,
    // e.g. addition: 2x + 4x^2 + x => 4x^2 + 3x
    // e.g. multiplication: 2x * x * x^2 => 2x^3
    collectAndCombineSearch,
    // e.g. (2 + x) / 4 => 2/4 + x/4
    breakUpNumeratorSearch,
    // e.g. 3/x * 2x/5 => (3 * 2x) / (x * 5)
    multiplyFractionsSearch,
    // e.g. (2x + 3)(x + 4) => 2x^2 + 11x + 12
    distributeSearch,
    // e.g. abs(-4) => 4
    functionsSearch,
  ];

  for (let i = 0; i < simplificationTreeSearches.length; i++) {
    nodeStatus = simplificationTreeSearches[i](node);
    // Always update node, since there might be changes that didn't count as
    // a step. Remove unnecessary parens, in case one a step results in more
    // parens than needed.
    node = removeUnnecessaryParens(nodeStatus.newNode, true);
    if (nodeStatus.hasChanged()) {
      node = flattenOperands(node);
      nodeStatus.newNode = clone(node);
      return nodeStatus;
    }
    else {
      node = flattenOperands(node);
    }
  }
  return Node.Status.noChange(node);
}
257863
function steps() {
	var cur = 0,
		steps = arguments;
	(function next(){
		process.nextTick(function(){
			steps[ cur++ ]( next );
		});
	})();
}
194697
private function step1()
    {
        // amente
        //      delete if in R1
        //      if preceded by iv, delete if in R2 (and if further preceded by at, delete if in R2), otherwise,
        //      if preceded by os, ic or abil, delete if in R2
        if ( ($position = $this->search(array('amente'))) !== false) {
            if ($this->inR1($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }

            // if preceded by iv, delete if in R2 (and if further preceded by at, delete if in R2), otherwise,
            if ( ($position2 = $this->searchIfInR2(array('iv'))) !== false) {
                $this->word = Utf8::substr($this->word, 0, $position2);
                if ( ($position3 = $this->searchIfInR2(array('at'))) !== false) {
                    $this->word = Utf8::substr($this->word, 0, $position3);
                }

                // if preceded by os, ic or ad, delete if in R2
            } elseif ( ($position4 = $this->searchIfInR2(array('os', 'ic', 'abil'))) != false) {
                $this->word = Utf8::substr($this->word, 0, $position4);
            }
            return true;
        }

        // delete if in R2
        if ( ($position = $this->search(array(
            'ibili', 'atrice', 'abili', 'abile', 'ibile', 'atrici', 'mente',
            'anza', 'anze', 'iche', 'ichi', 'ismo', 'ismi', 'ista', 'iste', 'isti', 'istà', 'istè', 'istì', 'ante', 'anti',
            'ico', 'ici', 'ica', 'ice', 'oso', 'osi', 'osa', 'ose'
        ))) !== false) {

            if ($this->inR2($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }
            return true;
        }

        // azione   azioni   atore   atori
        //      delete if in R2
        //      if preceded by ic, delete if in R2
        if ( ($position = $this->search(array('azione', 'azioni', 'atore', 'atori'))) !== false) {
            if ($this->inR2($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);

                if ( ($position2 = $this->search(array('ic'))) !== false) {
                    if ($this->inR2($position2)) {
                        $this->word = Utf8::substr($this->word, 0, $position2);
                    }
                }
            }
            return true;
        }

        // logia   logie
        //      replace with log if in R2
        if ( ($position = $this->search(array('logia', 'logie'))) !== false) {
            if ($this->inR2($position)) {
                $this->word = preg_replace('#(logia|logie)$#u', 'log', $this->word);
            }
            return true;
        }

        // uzione   uzioni   usione   usioni
        //      replace with u if in R2
        if ( ($position = $this->search(array('uzione', 'uzioni', 'usione', 'usioni'))) !== false) {
            if ($this->inR2($position)) {
                $this->word = preg_replace('#(uzione|uzioni|usione|usioni)$#u', 'u', $this->word);
            }
            return true;
        }

        // enza   enze
        //      replace with ente if in R2
        if ( ($position = $this->search(array('enza', 'enze'))) !== false) {
            if ($this->inR2($position)) {
                $this->word = preg_replace('#(enza|enze)$#u', 'ente', $this->word);
            }
            return true;
        }

        // amento   amenti   imento   imenti
        //      delete if in RV
        if ( ($position = $this->search(array('amento', 'amenti', 'imento', 'imenti'))) !== false) {
            if ($this->inRv($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }
            return true;
        }

        // ità
        //      delete if in R2
        //      if preceded by abil, ic or iv, delete if in R2
        if ( ($position = $this->search(array('ità'))) !== false) {
            if ($this->inR2($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }

            if ( ($position2 = $this->searchIfInR2(array('abil', 'ic', 'iv'))) != false) {
                $this->word = Utf8::substr($this->word, 0, $position2);
            }
            return true;
        }

        // ivo   ivi   iva   ive
        //      delete if in R2
        //      if preceded by at, delete if in R2 (and if further preceded by ic, delete if in R2)
        if ( ($position = $this->search(array('ivo', 'ivi', 'iva', 'ive'))) !== false) {
            if ($this->inR2($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }

            if ( ($position2 = $this->searchIfInR2(array('at'))) !== false) {
                $this->word = Utf8::substr($this->word, 0, $position2);
                if ( ($position3 = $this->searchIfInR2(array('ic'))) !== false) {
                    $this->word = Utf8::substr($this->word, 0, $position3);
                }
            }
            return true;
        }

        return false;
    }