Returns the default if the value is "empty"
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
574216
protected boolean isEmpty(Object value) {
        if (value == null)
            return true;
        if ( value.equals("") )
            return true;
        return false;
    }
903748
function(v) {
		return _.isNull(v) || (_.isString(v) && _.isEmpty(v));
	}
872655
public void isEmpty() {
    if (actual() == null) {
      failWithActual(simpleFact("expected empty optional"));
    } else if (actual().isPresent()) {
      failWithoutActual(
          simpleFact("expected to be empty"),
          fact("but was present with value", actual().getAsLong()));
    }
  }
1112526
public static AllowableValues emptyToNull(AllowableValues newValue, AllowableValues current) {
    if (newValue != null) {
      if (newValue instanceof AllowableListValues) {
        return defaultIfAbsent(emptyListValuesToNull((AllowableListValues) newValue), current);
      } else {
        return defaultIfAbsent(newValue, current);
      }
    }
    return current;
  }
746623
def default_value(self):
        
        if callable(self.default) and self.call_default:
            return self.default()
        return self.default
825873
def get_or(self, default: T) -> T:
        
        return default if self.value is None else self.value
193937
def default_value(tag)
      name, vr = LIBRARY.name_and_vr(tag)
      conversion = VALUE_CONVERSION[vr]
      case conversion
      when :to_i then return 0
      when :to_f then return 0.0
      else
        # Assume type is string and return an empty string:
        return ''
      end
    end
561353
def get_default(cls, category):
        """"""
        value = cls._DEFAULTS[category]
        if not value or not isinstance(value, list):
            return value
        return value[0]
1101697
function isEmpty (val) {
  if (null == val) return true;
  if ('number' == typeof val) return 0 === val;
  if (undefined !== val.length) return 0 === val.length;
  for (var key in val) if (has.call(val, key)) return false;
  return true;
}
874203
def p_DefaultValue_string(p):
  """"""
  p[0] = model.Value(type=model.Value.STRING, value=p[1])
278238
function(v, _default) {
    var vN = Number(v);
    return (isNaN(vN) || v == null || v === false || v == '') ? _default : vN;
  }
965261
function defaultIfEmpty(defaultValue) {
    if (defaultValue === void 0) {
        defaultValue = null;
    }
    return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); };
}
483924
def get_default_value(self, check):
        
        fun_name, fun_args, fun_kwargs, default = self._parse_with_caching(check)
        if default is None:
            raise KeyError('Check "%s" has no default value.' % check)
        value = self._handle_none(default)
        if value is None:
            return value
        return self._check_value(value, fun_name, fun_args, fun_kwargs)
159367
private Object evaluateDefaultValue()
    {
        Object val = _defaultValue;

        List defaults = null;
        if (val instanceof String) {
            if ("checked".equals(val)) {
                _defaultSingleton = true;
                _defaultSingleValue = true;
                return null;
            }
            else if ("unchecked".equals(val)) {
                _defaultSingleton = true;
                _defaultSingleValue = false;
                return null;
            }

            defaults = new ArrayList();
            defaults.add(val);
            return defaults;
        }

        Iterator optionsIterator = null;
        optionsIterator = IteratorFactory.createIterator(val);

        // log an error, default value is optional so only warn
        if (optionsIterator == null && _defaultValue != null) {
            logger.warn(Bundle.getString("Tags_IteratorError",
                    new Object[]{getTagName(), "defaultValue", _defaultValue}));
        }
        if (optionsIterator == null)
            optionsIterator = IteratorFactory.EMPTY_ITERATOR;

        defaults = new ArrayList();
        while (optionsIterator.hasNext()) {
            defaults.add(optionsIterator.next());
        }

        return defaults;
    }
331596
Object getDefaultValue(Session session) {

        return defaultExpression == null ? null
                                         : defaultExpression.getValue(session,
                                         dataType);
    }
1336707
public Optional<Object> getDefaultValue() {
        Validate.notNull(parameter, "parameter must not be null!");
        if (parameter instanceof AbstractSerializableParameter) {
            AbstractSerializableParameter serializableParameter = (AbstractSerializableParameter) parameter;
            return Optional.ofNullable(serializableParameter.getDefaultValue());
        }
        return Optional.empty();
    }