Normalize `a` with min/max values of `ref1`, using all elements of
    `ref1` where the `ref1` and `ref2` are not nan or inf
353352
def norm(a, ref1, ref2):
    
    ref = ref1[valid(ref1, ref2)]
    return (a-ref.min())/(ref.max()-ref.min())
178538
def normalize(x):
    ''''''
    x = x.astype(float)
    x -= x.mean()
    return x / float(x.std())
511540
public static DataRowsFacade normalize(DataRowsFacade dataFrame, double min, double max) {
        return normalize(dataFrame, min, max, Collections.<String>emptyList());
    }
857973
def normalized(beta, beta_list):
    
    if len(beta_list) <= 2:
        # beta_list元素小于等于2时，根据jiaccard相似度公式进行判定
        return 1
    try:
        result = (beta - min(beta_list)) / (max(beta_list) - min(beta_list))
    except ZeroDivisionError:
        result = 1
    return result
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
64672
function normalize(arr) {
    const n = copy(arr);
    let len = 0;
    for (const v of n) len += v * v;
    if (len > 0) {
        const coeff = 1 / Math.sqrt(len);
        for (let k = 0; k < n.length; k++) {
            n[k] *= coeff;
        }
    }
    return n;
}
13294
def min(self):
        """"""
        if "min" not in self.attrs.keys():

            def f(dataset, s):
                return np.nanmin(dataset[s])

            self.attrs["min"] = np.nanmin(list(self.chunkwise(f).values()))
        return self.attrs["min"]
1109055
def normalize_numbers(_numbers)
      numbers = _numbers.map(&:to_i)
      min = numbers.min
      numbers.map do |n|
        n - min
      end
    end
741430
def scale_values(numbers, num_lines=1, minimum=None, maximum=None):
    ""

    # find min/max values, ignoring Nones
    filtered = [n for n in numbers if n is not None]
    min_ = min(filtered) if minimum is None else minimum
    max_ = max(filtered) if maximum is None else maximum
    dv = max_ - min_

    # clamp
    numbers = [max(min(n, max_), min_) if n is not None else None for n in numbers]

    if dv == 0:
        values = [4 * num_lines if x is not None else None for x in numbers]
    elif dv > 0:
        num_blocks = len(blocks) - 1

        min_index = 1.
        max_index = num_lines * num_blocks

        values = [
            ((max_index - min_index) * (x - min_)) / dv + min_index
            if not x is None else None for x in numbers
        ]

        values = [round(v) or 1 if not v is None else None for v in values]
    return values
817603
def compare_version(version1, version2):
    
    def normalize(v):
        return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")]
    return (normalize(version1) > normalize(version2))-(normalize(version1) < normalize(version2))
138937
def normalize(v):
    ''''''
    if 0 == np.linalg.norm(v):
        return v
    return v / np.linalg.norm(v)
83788
def max_or_none(val1, val2):
    """"""
    return max(val1, val2, key=lambda x: -sys.maxint if x is None else x)
879891
def lpnormalization(attrs, inputs, proto_obj):
    """"""
    new_attrs = translation_utils._fix_attribute_names(attrs, {'p': 'ord'})
    axis = int(attrs.get("axis", -1))
    new_attrs.update(axis=axis)
    return 'norm', new_attrs, inputs
235492
def _get_normals(v):
    '''
    '''
    not_v = np.array([1, 0, 0])
    if np.all(np.abs(v) == not_v):
        not_v = np.array([0, 1, 0])
    n1 = np.cross(v, not_v)
    n1 /= norm(n1)
    n2 = np.cross(v, n1)
    return n1, n2
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
383283
def normalize_value(val):
    
    
    if val is not None:
        if val.lower() == 'false':
            val = False
        elif val.lower() == 'true':
            val = True
    
    return val
888859
function normalize (x, y) {
    const s = Math.hypot(x, y);
    return [x / s, y / s];
}