Assign a default value to a parameter.
353270
def _pv_default(opts, key, default_value)
        value = _pv_opts_lookup(opts, key)
        if value == nil
          opts[key] = default_value
        end
      end
1092510
def default(self, value):
        """"""

        if value is None:
            if self:
                value = list(self.keys())[0]

        elif not isinstance(value, string_types):
            value = register(exprresolver=value, reg=self)

        elif value not in self:
            raise KeyError(
                '{0} not registered in {1}'.format(value, self)
            )

        self._default = value
1232689
function assignPropertyWithDefault(destination, source, property, defaultValue) {
    var value = source[property];

    if (value == null) {
        value = defaultValue;
    }

    destination[property] = value;

    return value;
}
434708
def _check_default(value, parameter, default_chars):
    ''''''
    # not using a set here because it fails when value is unhashable
    if value in default_chars:
        if parameter.default is inspect.Parameter.empty:
            raise ValueError('Value was empty, but no default value is given in view function for parameter: {} ({})'.format(parameter.position, parameter.name))
        return parameter.default
    return value
1104506
def default_value(self, default_value):
        
        # For custom value
        if default_value not in self.default_values:
            if len(self.default_labels) == len(self.default_values):
                self.default_values[-1] = default_value
            else:
                self.default_values.append(default_value)

        self._default_value = default_value
585929
def value(self, data):
        """"""
        value = data.get(self.name)
        if value:
            return int(value)
        return self.default
61767
protected function setDefaultParams()
    {
        foreach ($this->allowedParams as $param => $options) {
            $this->params[$param] = null;
            if (! empty($options['arguments'])) {
                $this->params[$param] = array();
                foreach ($options['arguments'] as $arg => $opts) {
                    if (! empty($opts['default'])) {
                        $cast = ! empty($opts['cast']) ? $opts['cast'] : 'string';
                        $this->params[$param][$arg] = $this->castValue($cast, $opts['default']);
                    }
                }
            } elseif (! empty($options['default'])) {
                $cast = ! empty($options['cast']) ? $options['cast'] : 'string';
                $this->params[$param] = $this->castValue($cast, $options['default']);
            }
        }
    }
254142
public static void setParamDefault(
            final Multimap<String, String> params, final String key, final String value) {
        if (!params.containsKey(key)) {
            params.put(key, value);
        }
    }
92066
def param(self,key,default=None):
        """"""
        if key in self.parameters:
            return self.parameters[key]
        return default
246551
def set_ext_param(self, ext_key, param_key, val):
        '''
        
        '''
        if not self.extensions[ext_key]:
            self.extensions[ext_key] = defaultdict(lambda: None)
        self.extensions[ext_key][param_key] = val
252053
def setdefault (self, key, def_val=None):
        """"""
        if key in self:
            return self[key]
        self[key] = def_val
        return def_val
243814
protected void fillDefaultValues(Map<String, Value> params) {
        for (MethodParameter parameter : parameters.values()) {
            if (!parameter.isOptional() || parameter.getDefaultValue() == null || params.get(parameter.getName()) != null) continue;
            params.put(parameter.getName(), parameter.getDefaultValue());
        }
    }
1096133
private void setParameter(String key, Object value){
        if (value == null){
            parameters.remove(key);
        }     
        else{
            parameters.put(key, value);
        }
    }
305213
def p_default_option(self, p):
        """"""
        if p[1]:
            if isinstance(p[2], AstTagRef):
                p[0] = p[2]
            else:
                p[0] = p[2]
897718
def set_if_empty(self, param, default):
        
        if not self.has(param):
            self.set(param, default)
11866
protected function setDefaultValue() : void
    {
        if (empty($this->defaultOptions['default'])) {
            return;
        }

        // If we have a default value from configuration, pass it through
        // processing for magic/dynamic values like dates and usernames.
        $eventName = (string)EventName::FIELD_HANDLER_DEFAULT_VALUE();
        $event = new Event($eventName, $this, [
            'default' => $this->defaultOptions['default']
        ]);

        $view = $this->config->getView();
        $view->getEventManager()->dispatch($event);

        // Only overwrite the default if any events were triggered
        $listeners = $view->getEventManager()->listeners($eventName);
        if (empty($listeners)) {
            return;
        }
        $this->defaultOptions['default'] = $event->result;
    }
537247
def _add_property(self, name, default_value):
        

        name = str(name)
        self._properties[name] = default_value