normalize sequence by subtracting the mean and
  :param sequence: a list of data samples
  :param considerDimensions: a list of dimensions to consider
  :return: normalized sequence
199232
def normalizeSequence(sequence):
  
  seq = np.array(sequence).astype('float64')

  meanSeq = np.mean(seq)
  stdSeq = np.std(seq)
  seq = (seq - np.mean(seq)) / np.std(seq)

  sequence = seq.tolist()
  return sequence, meanSeq, stdSeq
299179
def normalized_distance(self, *sequences):
        
        return float(self.distance(*sequences)) / self.maximum(*sequences)
1324298
public void normalizeDepths( DMatrixRMaj depths ) {
		// normalize rows first
		for (int row = 0; row < depths.numRows; row++) {
			int idx = row*depths.numCols;
			double sum = 0;
			for (int col = 0; col < depths.numCols; col++) {
				double v = depths.data[idx++];
				sum += v*v;
			}
			double norm = Math.sqrt(sum)/depths.numCols;
			idx = row*depths.numCols;
			for (int j = 0; j < depths.numCols; j++) {
				depths.data[idx++] /= norm;
			}
		}

		// normalize columns
		for (int col = 0; col < depths.numCols; col++) {
			double norm = 0;
			for (int row = 0; row < depths.numRows; row++) {
				double v = depths.get(row,col);
				norm += v*v;
			}
			norm = Math.sqrt(norm);
			for (int row = 0; row < depths.numRows; row++) {
				depths.data[depths.getIndex(row,col)] /= norm;
			}
		}
	}
1112988
def normalize(self, inst, value):
        
        if (not (self.or_none and value is None) and
            self.seq):
            value = tuple(value)
        return value
355791
def set_sequence_from_str(self, sequence):
        
        self._qsequences = [QKeySequence(s) for s in sequence.split(', ')]
        self.update_warning()
1164818
public void normalizeScale() {
		double sum = 0;

		sum += SpecializedOps_DDRM.elementSumSq(T1);
		sum += SpecializedOps_DDRM.elementSumSq(T2);
		sum += SpecializedOps_DDRM.elementSumSq(T3);

		double n = Math.sqrt(sum);

		CommonOps_DDRM.scale(1.0/n,T1);
		CommonOps_DDRM.scale(1.0/n,T2);
		CommonOps_DDRM.scale(1.0/n,T3);
	}
227765
def _insert_from_ordered_sequence(self, seq):
        
        if len(seq) == 0:
            return
        mid, greater, lesser = self._bisect(seq)
        self.insert(mid)
        self._insert_from_ordered_sequence(greater)
        self._insert_from_ordered_sequence(lesser)
204427
def calculate_size(name, sequence):
    
    data_size = 0
    data_size += calculate_size_str(name)
    data_size += LONG_SIZE_IN_BYTES
    return data_size
213890
def l2_batch_normalize(x, epsilon=1e-12, scope=None):
  
  with tf.name_scope(scope, "l2_batch_normalize") as name_scope:
    x_shape = tf.shape(x)
    x = tf.contrib.layers.flatten(x)
    x /= (epsilon + reduce_max(tf.abs(x), 1, keepdims=True))
    square_sum = reduce_sum(tf.square(x), 1, keepdims=True)
    x_inv_norm = tf.rsqrt(np.sqrt(epsilon) + square_sum)
    x_norm = tf.multiply(x, x_inv_norm)
    return tf.reshape(x_norm, x_shape, name_scope)
1243504
def LastOf(*subcons):
    
    name = "seq"
    if isinstance(subcons[0], six.string_types):
        name = subcons[0]
        subcons = subcons[1:]
    return IndexingAdapter(Sequence(name, *subcons), -1)
1221436
def subseq(start_offset=0, end_offset=None):
    
    def _(sequence):
        return sequence.subseq(start_offset, end_offset)
    return _
520250
def normalize_chunks(chunks, shape, typesize):
    """"""

    # N.B., expect shape already normalized

    # handle auto-chunking
    if chunks is None or chunks is True:
        return guess_chunks(shape, typesize)

    # handle no chunking
    if chunks is False:
        return shape

    # handle 1D convenience form
    if isinstance(chunks, numbers.Integral):
        chunks = (int(chunks),)

    # handle bad dimensionality
    if len(chunks) > len(shape):
        raise ValueError('too many dimensions in chunks')

    # handle underspecified chunks
    if len(chunks) < len(shape):
        # assume chunks across remaining dimensions
        chunks += shape[len(chunks):]

    # handle None in chunks
    chunks = tuple(s if c is None else int(c)
                   for s, c in zip(shape, chunks))

    return chunks
273559
def _normalize_batch(b:Tuple[Tensor,Tensor], mean:FloatTensor, std:FloatTensor, do_x:bool=True, do_y:bool=False)->Tuple[Tensor,Tensor]:
    ""
    x,y = b
    mean,std = mean.to(x.device),std.to(x.device)
    if do_x: x = normalize(x,mean,std)
    if do_y and len(y.shape) == 4: y = normalize(y,mean,std)
    return x,y
396108
def flatten_multi_dim(sequence):
    
    for x in sequence:
        if (isinstance(x, collections.Iterable)
                and not isinstance(x, six.string_types)):
            for y in flatten_multi_dim(x):
                yield y
        else:
            yield x
333251
def partial_fit(self, sequence, y=None):
        
        s = super(MultiSequencePreprocessingMixin, self)
        if hasattr(s, 'fit'):
            return s.fit(sequence)
        return self
1285026
public void fitOnSequences(Integer[][] sequences) {
        documentCount += 1;
        for (Integer[] sequence: sequences) {
            Set<Integer> sequenceSet = new HashSet<>(Arrays.asList(sequence));
            for (Integer index: sequenceSet)
                indexDocs.put(index, indexDocs.get(index) + 1);
        }
    }
1106233
function get_sequence(self, weight) {
  if (undefined === self.__sequences__[weight]) {
    self.__sequences__[weight] = [];
  }

  return self.__sequences__[weight];
}