Normalise the input parameters within their upper and lower
        defined range
328560
def get_pn(self, rup, sites, dists, sof):
        
        # List must be in following order
        p_n = []
        # Rjb
        # Note that Rjb must be clipped at 0.1 km
        rjb = rhypo_to_rjb(dists.rhypo, rup.mag)
        rjb[rjb < 0.1] = 0.1
        p_n.append(self._get_normalised_term(np.log10(rjb),
                                             self.CONSTANTS["logMaxR"],
                                             self.CONSTANTS["logMinR"]))
        # Magnitude
        p_n.append(self._get_normalised_term(rup.mag,
                                             self.CONSTANTS["maxMw"],
                                             self.CONSTANTS["minMw"]))
        # Vs30
        p_n.append(self._get_normalised_term(np.log10(sites.vs30),
                                             self.CONSTANTS["logMaxVs30"],
                                             self.CONSTANTS["logMinVs30"]))
        # Depth
        p_n.append(self._get_normalised_term(rup.hypo_depth,
                                             self.CONSTANTS["maxD"],
                                             self.CONSTANTS["minD"]))
        # Style of Faulting
        p_n.append(self._get_normalised_term(sof,
                                             self.CONSTANTS["maxFM"],
                                             self.CONSTANTS["minFM"]))
        return p_n
881881
function normalizeInput(input) {
    var ret;
    if (input instanceof Uint8Array) {
        ret = input;
    }
    else if (input instanceof Buffer) {
        ret = new Uint8Array(input);
    }
    else if (typeof (input) === 'string') {
        ret = new Uint8Array(Buffer.from(input, 'utf8'));
    }
    else {
        throw new Error(ERROR_MSG_INPUT);
    }
    return ret;
}
81315
def normalized(word)
      h = self[word]
      max = h.values.max

      return h if max == 0.0

      h.each do |word, value|
        h[word] = value / max
      end

      h
    end
468358
def normalize(self):
        
        maximum = self.max()
        if maximum:
            self.values = [value / maximum for value in self.values]
318336
def _normalize(self):
        ""
        l,m,n = self.powers
        self.norm = np.sqrt(pow(2,2*(l+m+n)+1.5)*
                            pow(self.exponent,l+m+n+1.5)/
                            fact2(2*l-1)/fact2(2*m-1)/
                            fact2(2*n-1)/pow(np.pi,1.5))
        return
407817
def normalize_input_values(config, devices):
    '''
    
    '''
    if isinstance(config, list):
        if (config and
                'key' in config[0] and
                'value' in config[0]):
            config = {d['key']: d['value'] for d in config}
        else:
            config = {}

    if isinstance(config, six.string_types):
        raise SaltInvocationError(
            "config can't be a string, validate your YAML input."
        )

    if isinstance(devices, six.string_types):
        raise SaltInvocationError(
            "devices can't be a string, validate your YAML input."
        )

    # Golangs wants strings
    if config is not None:
        for k, v in six.iteritems(config):
            config[k] = six.text_type(v)
    if devices is not None:
        for dn in devices:
            for k, v in six.iteritems(devices[dn]):
                devices[dn][k] = v

    return (config, devices,)
852417
def setParams(self, minSupport=0.1, maxPatternLength=10, maxLocalProjDBSize=32000000,
                  sequenceCol="sequence"):
        
        kwargs = self._input_kwargs
        return self._set(**kwargs)
1200214
def sigmoid_range(x, low, high):
    ""
    return torch.sigmoid(x) * (high - low) + low
685305
def _limit_value(value, upper=1.0, lower=0.0):
    
    if value > upper:
        return(upper)
    if value < lower:
        return(lower)
    return value
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
1158342
function normalize (obj) {
	if (!obj.dtype) {
		obj.dtype = defaultDtype[obj.type] || 'array'
	}

	//provide limits
	switch (obj.dtype) {
		case 'float32':
		case 'float64':
		case 'audiobuffer':
		case 'ndsamples':
		case 'ndarray':
			obj.min = -1
			obj.max = 1
			break;
		case 'uint8':
			obj.min = 0
			obj.max = 255
			break;
		case 'uint16':
			obj.min = 0
			obj.max = 65535
			break;
		case 'uint32':
			obj.min = 0
			obj.max = 4294967295
			break;
		case 'int8':
			obj.min = -128
			obj.max = 127
			break;
		case 'int16':
			obj.min = -32768
			obj.max = 32767
			break;
		case 'int32':
			obj.min = -2147483648
			obj.max = 2147483647
			break;
		default:
			obj.min = -1
			obj.max = 1
			break;
	}

	return obj
}
1156507
def scale(input_value, input_min, input_max, out_min, out_max):
    
    # Figure out how 'wide' each range is
    input_span = input_max - input_min
    output_span = out_max - out_min
    # Convert the left range into a 0-1 range (float)
    valuescaled = float(input_value - input_min) / float(input_span)
    # Convert the 0-1 range into a value in the right range.
    return out_min + (valuescaled * output_span)
52192
def normalize_value(value):
	""""""

	value = str(value)
	value = value.casefold()

	value = re.sub(r'\/\s*\d+', '', value)  # Remove "/<totaltracks>" from track number.
	value = re.sub(r'^0+([0-9]+)', r'\1', value)  # Remove leading zero(s) from track number.
	value = re.sub(r'^(\d+)\.+', r'\1', value)  # Remove dots from track number.
	value = re.sub(r'[^\w\s]', '', value)  # Remove leading non-word characters.
	value = re.sub(r'^the\s+', '', value)  # Remove leading "the".
	value = re.sub(r'^\s+', '', value)  # Remove leading spaces.
	value = re.sub(r'\s+$', '', value)  # Remove trailing spaces.
	value = re.sub(r'\s+', ' ', value)  # Reduce multiple spaces to a single space.

	return value
678629
def normalize(self):
		
		for i, (_, amplitude, phase) in enumerate(self.model):
			if amplitude < 0:
				self.model['amplitude'][i] = -amplitude
				self.model['phase'][i] = phase + 180.0
			self.model['phase'][i] = np.mod(self.model['phase'][i], 360.0)
174749
def normalize_value(values)
      Array.wrap(values).map do |value|
        value.is_a?(String) ? value.gsub("\n", "") : value
      end
    end
1109055
def normalize_numbers(_numbers)
      numbers = _numbers.map(&:to_i)
      min = numbers.min
      numbers.map do |n|
        n - min
      end
    end
178538
def normalize(x):
    ''''''
    x = x.astype(float)
    x -= x.mean()
    return x / float(x.std())