method to sanitize model parameters

        Parameters
        ---------
        None

        Returns
        -------
        None
773763
def _validate_arguments(self):
        
        if self._has_terms():
            [term._validate_arguments() for term in self._terms]
        else:
            super(TensorTerm, self)._validate_arguments()

        return self
299445
def clean(self):
        
        raise forms.ValidationError(
            self.error_messages['invalid_login'],
            code='invalid_login',
            params={'username': self.username_field.verbose_name}
        )
69257
def post_params
			# Ensure post title is sanitized of all HTML
			if params[:post].include? :title
				params[:post][:title] = HTMLEntities.new.decode(Rails::Html::FullSanitizer.new.sanitize(params[:post][:title]))
			end

			params.require(:post).permit(:title,
			                             :body,
			                             images_attributes: [:id, :image, :_destroy])
		end
1350525
function sanitizeParameters (definition) {
    let scalar;
    try {
        // eslint-disable-next-line no-use-before-define
        const vector = Vector.from(definition);
        scalar = vector.getDelta();
    }
    catch (e) {
        scalar = definition.getDelta ? definition.getDelta() : definition;
    }
    return scalar;
}
447196
def sanitize_resource_schema(r):
    
    if 'schema' in r.descriptor:
        r.descriptor['schema'] = _sanitize_schema(r.descriptor['schema'])

    return r
278312
def rm_parameter(self, name):
        
        if name not in self._parameters:
            raise ValueError("no '%s' parameter found" % (name))

        del self._parameters[name]
        del self.__dict__[name]
779441
def sanitize_args(cmd: List[str]) -> List[str]:
    
    sanitized = []
    for idx, fieldname in enumerate(cmd):
        def _is_password(cmdstr):
            return 'wifi-sec.psk' in cmdstr\
                or 'password' in cmdstr.lower()
        if idx > 0 and _is_password(cmd[idx-1]):
            sanitized.append('****')
        else:
            sanitized.append(fieldname)
    return sanitized
1256510
def _sanitize_entity(self, entity):
        
        aliases = {
            "current_state": "state",
            "is_flapping": "flapping",
            "scheduled_downtime_depth": "in_downtime",
            "has_been_checked": "checked",
            "should_be_scheduled": "scheduled",
            "active_checks_enabled": "active_checks",
            "passive_checks_enabled": "passive_checks",
        }
        sane = {}
        for akey in aliases.keys():
            sane[aliases[akey]] = None

        aliases_keys = aliases.keys()
        for key in entity.keys():
            if key not in aliases_keys:
                continue

            alias = aliases[key]
            try:
                sane[alias] = int(entity[key])
            except Exception:
                sane[alias] = None

        if sane["active_checks"] not in [0, 1]:
            sane["active_checks"] = 0
        elif sane["active_checks"] == 1:
            sane["passive_checks"] = 0

        if sane["passive_checks"] not in [0, 1]:
            sane["passive_checks"] = 0

        return sane
481751
def sanitize(func):
    

    def wrapper(*args, **kwargs):
        return normalize('NFC', func(*args, **kwargs))
    return wrapper
1121130
def clean(self, value):
        """"""

        for parameter_obj in self.types:
            try:
                return parameter_obj.clean(value)
            except ParameterNotValidError:
                continue

        raise ParameterNotValidError
746705
def sanitize_parse_mode(mode):
    
    if not mode:
        return None

    if callable(mode):
        class CustomMode:
            @staticmethod
            def unparse(text, entities):
                raise NotImplementedError

        CustomMode.parse = mode
        return CustomMode
    elif (all(hasattr(mode, x) for x in ('parse', 'unparse'))
          and all(callable(x) for x in (mode.parse, mode.unparse))):
        return mode
    elif isinstance(mode, str):
        try:
            return {
                'md': markdown,
                'markdown': markdown,
                'htm': html,
                'html': html
            }[mode.lower()]
        except KeyError:
            raise ValueError('Unknown parse mode {}'.format(mode))
    else:
        raise TypeError('Invalid parse mode type {}'.format(mode))
76552
def remove_model(self, model, **kwargs):
        
        kwargs['model'] = model
        kwargs['context'] = 'model'
        self.remove_parameters_all(**kwargs)
374230
def method_missing(meth, value)
      meth = sanitize_setter_method(meth)

      if defaults.key?(meth)
        @options[meth] = value
      else
        super
      end
    end
663589
def sanitize(self):
        '''
        
        '''
        super(MapReferralMessage, self).sanitize()

        # WARNING: http://tools.ietf.org/html/draft-ietf-lisp-ddt-00
        # does not define this field so the description is taken from
        # http://tools.ietf.org/html/draft-ietf-lisp-24
        #
        # Nonce: An 8-octet random value created by the sender of the Map-
        # Request.  This nonce will be returned in the Map-Reply.  The
        # security of the LISP mapping protocol depends critically on the
        # strength of the nonce in the Map-Request message.  The nonce
        # SHOULD be generated by a properly seeded pseudo-random (or strong
        # random) source.  See [RFC4086] for advice on generating security-
        # sensitive random data.
        if len(bytes(self.nonce)) != 8:
            raise ValueError('Invalid nonce')

        # Map-Referral Records:  When the M bit is set, this field is the size
        # of a single "Record" in the Map-Reply format.  This Map-Reply record
        # contains the EID-to-RLOC mapping entry associated with the Source
        # EID.  This allows the ETR which will receive this Map-Request to
        # cache the data if it chooses to do so.
        for record in self.records:
            if not isinstance(record, MapReferralRecord):
                raise ValueError('Invalid record')

            record.sanitize()
652384
def clean(self):
        
        errors = {}
        cleaned = {}

        for name, validator in self.validate_schema.items():
            val = getattr(self, name, None)
            try:
                cleaned[name] = validator.to_python(val)
            except formencode.api.Invalid, err:
                errors[name] = err

        if errors:
            raise ValidationError('Invalid data', errors)
        return cleaned
1075052
def sanitize(self):
        '''
        
        '''
        # Check ports
        if not isinstance(self.source_port, numbers.Integral) \
        or self.source_port < 0 \
        or self.source_port >= 2 ** 16:
            raise ValueError('Invalid source port')

        if not isinstance(self.destination_port, numbers.Integral) \
        or self.destination_port < 0 \
        or self.destination_port >= 2 ** 16:
            raise ValueError('Invalid destination port')
1027937
def _clean_params(self, params):
        
        clean_params = {}
        for key, value in params.iteritems():
            if value is not None:
                clean_params[key] = value

        return clean_params