code: def normalize(vector, cutoffp=(0, 100), model=False):
      r"""
      Returns a feature-wise normalized version of the supplied vector. Normalization is
      achieved to [0,1] over the complete vector using shifting and scaling.
  
      When cut-off percentile (cutoffp) values other than (0, 100) are supplied, the values
      lying before or behind the supplied percentiles are cut-off i.e. shifted to fit the
      range.
  
      When model is set to True, an additional model describing the normalization is
      returned, that can at a later point be passed to the `normalize_with_model` function
      to normalize other feature vectors accordingly to the one passed.
  
      The vector is expected to have the form samples*features i.e.::
  
              s1    s2    s3    [...]
          f1
          f2
          [...]
  
      Therefore a supplied vector::
  
              s1    s2    s3
          f1   1.5    1    2
          f2    -1    0    1
  
      would result in the returned vector::
  
              s1    s2    s3
          f1 0.50  0.00  1.00
          f2 0.00  0.50  1.00
  
      Parameters
      ----------
      vector : sequence
          A sequence of feature vectors to normalize.
      cutoffp : (float, float)
          Cut-off percentiles.
      model : bool
          Whether to return the learned normalization model.
  
      Returns
      -------
      normalized_feature_vectors : ndarray
          The normalized versions of the input vectors.
      model : tuple, optional
          The learned normalization model.
  
      """
      vector = numpy.array(vector, dtype=float)
  
      # add a singleton dimension if required
      if 1 == vector.ndim:
          vector = vector[:, None]
  
      # compute lower and upper range border of each row using the supplied percentiles
      minp, maxp = numpy.percentile(vector, cutoffp, 0)
  
      # shift outliers to fit range
      for i in range(vector.shape[1]):
          vector[:, i][vector[:, i] < minp[i]] = minp[i]
          vector[:, i][vector[:, i] > maxp[i]] = maxp[i]
  
      # normalize
      minv = vector.min(0)
      vector -= minv
      maxv = vector.max(0)
      vector /= maxv
  
      if not model:
          return vector
      else:
          return vector, (minp, maxp, minv, maxv)
  
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: normalize(vector, cutoffp, model) and returns: vector, vector,  minp,  maxp,  minv,  maxv