determine the normalization needed for the children array. 0: no normalization needed 1: simple normalization needed (possible 1-level deep nested array) 2: full normalization needed
484677
function getNormalizationType (
  children,
  maybeComponent
) {
  var res = 0;
  for (var i = 0; i < children.length; i++) {
    var el = children[i];
    if (el.type !== 1) {
      continue
    }
    // TODO: a better normalization mode without text node combination
    // it was 2 full normalizatiom before
    // but it will combine two adjacent text node which will cause hid and context infomation lost
    if (needsNormalization(el) ||
        (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
      // res = 2
      res = 1;
      break
    }
    if (maybeComponent(el) ||
        (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
      res = 1;
    }
  }
  return res
}
69814
function normalizeLevel(level) {
  if (level.value <= Logger.Level.ALL.value) {          // ALL is 0.
    return Logger.Level.ALL;

  } else if (level.value === Logger.Level.OFF.value) {  // OFF is Infinity
    return Logger.Level.OFF;

  } else if (level.value < Logger.Level.INFO.value) {
    return Logger.Level.DEBUG;

  } else if (level.value < Logger.Level.WARNING.value) {
    return Logger.Level.INFO;

  } else if (level.value < Logger.Level.SEVERE.value) {
    return Logger.Level.WARNING;

  } else {
    return Logger.Level.SEVERE;
  }
}
991411
function normalize( x ) {
	if ( x !== x || isinfinite( x ) ) {
		return [ x, 0 ];
	}
	if ( x !== 0 && abs( x ) < SMALLEST_FLOAT64 ) {
		return [ x*SCALAR, -52 ];
	}
	return [ x, 0 ];
}
159516
private static boolean checkAboutNormalization(String args[]) {
    boolean normalize = false ;
    if (args.length == 4) {
      if (args[3].equals("TRUE")) {
        normalize = true;
      } else if (args[3].equals("FALSE")) {
        normalize = false;
      } else {
        throw new JMetalException("The value for normalizing must be TRUE or FALSE");
      }
    }

    return normalize ;
  }
1356629
def normalize(X):
        
        a = X.min(axis=0)
        b = X.max(axis=0)
        return (X - a[np.newaxis, :]) / ((b - a)[np.newaxis, :])
468358
def normalize(self):
        
        maximum = self.max()
        if maximum:
            self.values = [value / maximum for value in self.values]
106207
function normalizeRanks(g) {
  var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));
  _.forEach(g.nodes(), function(v) {
    var node = g.node(v);
    if (_.has(node, "rank")) {
      node.rank -= min;
    }
  });
}
773862
def depth(self) -> int:
        
        if len(self.children):
            return 1 + max([child.depth for child in self.children])
        else:
            return 1
1351508
function normalize(hash, strategy, recursive) {
		hash = as(Object, hash, {});
		strategy = as(Function, strategy, dotDefault);
		recursive = as(Boolean, recursive, true);
		for (var key in hash) {
			if (ownProperty(hash, key)) {
				if (recursive && object(hash[key])) {
					normalize(hash[key], strategy, recursive);
				} else {
					write(hash, key, deletePropertyAt(hash, key), strategy);
				}
			}
		}
		return hash;
	}
1228501
function( s ){

    if( s.match(/\./ ) ){

      var l = s.split( /\./ );
      for( var i = 0; i < l.length-1; i++ ){
        l[ i ] = '_children.' + l[ i ];
      }
      return l.join( '.' );

    } else {
      return s;
    }
  }
478510
final void normalize() {
        if (intLen == 0) {
            offset = 0;
            return;
        }

        int index = offset;
        if (value[index] != 0)
            return;

        int indexBound = index+intLen;
        do {
            index++;
        } while(index < indexBound && value[index] == 0);

        int numZeros = index - offset;
        intLen -= numZeros;
        offset = (intLen == 0 ?  0 : offset+numZeros);
    }
157486
function parseChildrenProperties( root, libs, com, indent ) {
  if (!Array.isArray( root.children )) {
    root.children = [ ];
  }
  root.children.forEach( function( child ) {
    debugger;
    if ( child.type != libs.Tree.TAG ) {
      return;
    }
    libs.compileChildren( child );

    if ( typeof child.attribs === 'undefined' ) {
      child.attribs = {};
    }
    if ( child.attribs.json === null ) {
      parsePropertyJSON( child, libs, com );
    }
    else {
      // By default, this is a list.
      parsePropertyList( child, libs, com, indent + "  " );
    }
  });
}
1323561
@SuppressWarnings("UnusedDeclaration")
    public int getNestedChildCount() {
        ArrayList<Account> stack = new ArrayList<Account>();
        int size = 0;

        stack.add(this);
        while (stack.size() > 0) {
            Account current = stack.get(0);
            stack.remove(0);
            for (Account child : current.getChildren()) {
                size++;
                if (child.hasChildren())
                    stack.add(child);
            }
        }

        return size;
    }
428465
public static void computeNormalizationLL(List<List<Point2D_F64>> points, NormalizationPoint2D normalize )
	{
		double meanX = 0;
		double meanY = 0;

		int count = 0;

		for (int i = 0; i < points.size(); i++) {
			List<Point2D_F64> l = points.get(i);
			for (int j = 0; j < l.size(); j++) {
				Point2D_F64 p = l.get(j);
				meanX += p.x;
				meanY += p.y;
			}
			count += l.size();
		}

		meanX /= count;
		meanY /= count;

		double stdX = 0;
		double stdY = 0;

		for (int i = 0; i < points.size(); i++) {
			List<Point2D_F64> l = points.get(i);
			for (int j = 0; j < l.size(); j++) {
				Point2D_F64 p = l.get(j);
				double dx = p.x - meanX;
				double dy = p.y - meanY;
				stdX += dx*dx;
				stdY += dy*dy;
			}
		}

		normalize.meanX = meanX;
		normalize.meanY = meanY;

		normalize.stdX = Math.sqrt(stdX/count);
		normalize.stdY = Math.sqrt(stdY/count);
	}
298395
function(row, tmpRowDepth) {
                tmpRowDepth = tmpRowDepth || 1;

                for(var n=0; n<row.length; n++) {
                    var col = row[n];
                    // Column has children, so keep counting
                    if(YAHOO.lang.isArray(col.children)) {
                        tmpRowDepth++;
                        countMaxRowDepth(col.children, tmpRowDepth);
                        tmpRowDepth--;
                    }
                    // No children, is it the max depth?
                    else {
                        if(tmpRowDepth > maxRowDepth) {
                            maxRowDepth = tmpRowDepth;
                        }
                    }

                }
            }
494732
void get_valency_features(final Context ctx,
                              final List<Integer> nr_left_children,
                              final List<Integer> nr_right_children,
                              List<Integer> features)
    {
        if (!use_valency)
        {
            return;
        }

        int lvc = 8;
        int rvc = 8;
        if (ctx.S0 >= 0)
        {
            lvc = math.binned_1_2_3_4_5_6_10[nr_left_children.get(ctx.S0)];
            rvc = math.binned_1_2_3_4_5_6_10[nr_right_children.get(ctx.S0)];
            if (lvc == 10)
            {
                lvc = 7;
            }
            if (rvc == 10)
            {
                rvc = 7;
            }
        }
        features.add(lvc + kValencyInFeaturespace);
        features.add(rvc + kValencyInFeaturespace);

        lvc = 8;
        rvc = 8;
        if (ctx.S1 >= 0)
        {
            lvc = math.binned_1_2_3_4_5_6_10[nr_left_children.get(ctx.S1)];
            rvc = math.binned_1_2_3_4_5_6_10[nr_right_children.get(ctx.S1)];
            if (lvc == 10)
            {
                lvc = 7;
            }
            if (rvc == 10)
            {
                rvc = 7;
            }
        }
        features.add(lvc + kValencyInFeaturespace);
        features.add(rvc + kValencyInFeaturespace);
    }
880817
def _normalise(self):
        
        if not self.is_unit():
            n = self.norm
            if n > 0:
                self.q = self.q / n