standardize Y in a way that is robust to missing values
    in_place: create a copy or carry out inplace opreations?
173938
def standardize(Y,in_place=False):
    
    if in_place:
        YY = Y
    else:
        YY = Y.copy()
    for i in range(YY.shape[1]):
        Iok = ~SP.isnan(YY[:,i])
        Ym = YY[Iok,i].mean()
        YY[:,i]-=Ym
        Ys = YY[Iok,i].std()
        YY[:,i]/=Ys
    return YY
1261820
def _missing_values_set_to_nan(values, missing_value, sparse_missing):
    
    if sp.issparse(values):
        assert values.shape[0] == 1
    if sparse_missing and sp.issparse(values) and missing_value != 0:
        # Nothing special needs to be done for missing.value == 0 because
        # missing values are assumed to be zero in sparse matrices.
        values_coo = values.tocoo()
        values = values.toarray()[0]
        missing_mask = values == 0
        # fix for possible zero values
        missing_mask[values_coo.col] = False
        values[missing_mask] = np.nan
    elif is_sparse_vector(values):
        values = values.toarray()[0]
    else:
        values = values.copy()
    if not np.isnan(missing_value):
        values[values == missing_value] = np.nan
    return values
202915
public void replaceData(double[] newXData, double[] newYData, double[] newExtraValues) {

    // Sanity check
    if (newExtraValues != null && newExtraValues.length != newYData.length) {
      throw new IllegalArgumentException("error bars and Y-Axis sizes are not the same!!!");
    }
    if (newXData.length != newYData.length) {
      throw new IllegalArgumentException("X and Y-Axis sizes are not the same!!!");
    }

    xData = newXData;
    yData = newYData;
    extraValues = newExtraValues;
    
    setAllData();
    
    calculateMinMax();
  }
888859
function normalize (x, y) {
    const s = Math.hypot(x, y);
    return [x / s, y / s];
}
717550
def normalize_version(version):
    
    rv = []
    for x in version.split("."):
        try:
            rv.append(int(x))
        except ValueError:
            for y in re.split("([0-9]+)", x):
                if y == '':
                    continue
                try:
                    rv.append(int(y))
                except ValueError:
                    rv.append(y)
    return rv
199727
def _scale_y_values(self, values, new_min, new_max, scale_old_from_zero=True):
        '''
        
        '''
        # Scale Y values - Create a scaled list of values to use for the visual graph
        scaled_values = []
        y_min_value = min(values)
        if scale_old_from_zero:
            y_min_value = 0
        y_max_value = max(values)
        new_min = 0
        OldRange = (y_max_value - y_min_value) or 1  # Prevents division by zero if all values are the same
        NewRange = (new_max - new_min)  # max_height is new_max
        for old_value in values:
            new_value = (((old_value - y_min_value) * NewRange) / OldRange) + new_min
            scaled_values.append(new_value)
        return scaled_values
80567
def normalize_pts(pts, ymax, scaler=2):
    
    return [(x * scaler, ymax - (y * scaler)) for x, y in pts]
149479
def standardize_genes(self, inplace=False):
        """"""
        matrix = self.center_genes(inplace=inplace)
        matrix.X[:,:] = matrix.X / \
            np.tile(np.std(matrix.X, axis=1, ddof=1), (matrix.n, 1)).T
        return matrix
402400
def _replace_missing_values_column(values, mv):
    
    for idx, v in enumerate(values):
        try:
            if v in EMPTY or v == mv:
                values[idx] = "nan"
            elif math.isnan(float(v)):
                values[idx] = "nan"
            else:
                values[idx] = v
        except (TypeError, ValueError):
            values[idx] = v

    return values
172571
def standardize(self):
        


        nonmissing = numpy.invert(self.missing)
        nmcount = numpy.sum(nonmissing)

        self.covariates = []
        self.phenotypes = []

        for idx in range(0, self.covar_count):
            x = self.datasource.covariate_data[idx]
            nonmissing = x != PhenoCovar.missing_encoding
            mx = numpy.mean(x[nonmissing])
            sx = numpy.std(x[nonmissing])
            self.covariates.append((x-mx)/sx)

        for idx in range(0, self.pheno_count):
            y = self.datasource.phenotype_data[idx]
            nonmissing = y != PhenoCovar.missing_encoding
            my = numpy.mean(y[nonmissing])
            sy = numpy.std(y[nonmissing])
            self.phenotypes.append((y-my)/sy)
764871
def position_to_value(self, y):
        """"""
        vsb = self.editor.verticalScrollBar()
        return vsb.minimum()+max([0, (y-self.offset)/self.get_scale_factor()])
305225
def _batch_norm_new_params(input_shape, rng, axis=(0, 1, 2),
                           center=True, scale=True, **kwargs):
  """"""
  del rng, kwargs
  axis = (axis,) if np.isscalar(axis) else axis
  shape = tuple(d for i, d in enumerate(input_shape) if i not in axis)
  beta = np.zeros(shape, dtype='float32') if center else ()
  gamma = np.ones(shape, dtype='float32') if scale else ()
  return (beta, gamma)
1002176
def notequal(x, y):
    
    x = BigFloat._implicit_convert(x)
    y = BigFloat._implicit_convert(y)
    return not mpfr.mpfr_equal_p(x, y)
697716
def transform(self, y):
        
        check_is_fitted(self, 'classes_')
        y = column_or_1d(y, warn=True)

        classes = np.unique(y)
        _check_numpy_unicode_bug(classes)
        if len(np.intersect1d(classes, self.classes_)) < len(classes):
            diff = np.setdiff1d(classes, self.classes_)
            raise ValueError("y contains new labels: %s" % str(diff))
        return np.searchsorted(self.classes_, y)
1265658
def normalizeY(value):
    
    if not isinstance(value, (int, float)):
        raise TypeError("Y coordinates must be instances of "
                        ":ref:`type-int-float`, not %s."
                        % type(value).__name__)
    return value
712916
def at_least_libvips(x, y):
    """"""

    major = version(0)
    minor = version(1)

    return major > x or (major == x and minor >= y)
437110
def normalize(self):
        """"""
        if self.x1 < self.x0:
            self.x0, self.x1 = self.x1, self.x0
        if self.y1 < self.y0:
            self.y0, self.y1 = self.y1, self.y0
        return self