Returns the given value or the specified default value for this
        field
350900
def value_or_default(self, value):
        '''  '''
        if value is None:
            if callable(self.default):
                return self.default()
            else:
                return self.default

        return value
997819
def get(self, option, default=None):
        ''''''
        val = self[option]
        return (val is None and default) or val
852321
def default_value(self, argname):
        
        i = _find_arg(argname, self.args)[0]
        if i is not None:
            idx = i - (len(self.args) - len(self.defaults))
            if idx >= 0:
                return self.defaults[idx]
        i = _find_arg(argname, self.kwonlyargs)[0]
        if i is not None and self.kw_defaults[i] is not None:
            return self.kw_defaults[i]
        raise exceptions.NoDefault(func=self.parent, name=argname)
526508
public String getValueWithDefault(String keyMsgType, String defaultVal) {
        return keyToValue.getOrDefault(keyMsgType, defaultVal);
    }
680970
def to_string_with_default(value, default_value):
        
        result = StringConverter.to_nullable_string(value)
        return result if result != None else default_value
273894
public static Long getValue(final Long value, final Long defaultValue) {

    return value == null ? defaultValue : value;
  }
205032
def default(self):
        
        if isinstance(self.__default, (str, unicode)):
            return self.valueFromString(self.__default)
        else:
            return self.__default
62246
def default_value(self):
        
        data = clips.data.DataObject(self._env)

        lib.EnvSlotDefaultValue(
            self._env, self._cls, self._name, data.byref)

        return data.value
274354
def field_or_value(clause):
    
    if hasattr(clause, "getName") and clause.getName() != "field":
        return Value(resolve(clause))
    else:
        return Field(clause)
255812
public static DefaultValueFunction defaultValue(Field field, Object defaultValue) {

		Assert.notNull(field, "Field must not be 'null' for default value operation.");

		return new DefaultValueFunction(field, defaultValue);
	}
160882
public static final boolean valueIsNotDefault(FieldType type, Object value)
   {
      boolean result = true;

      if (value == null)
      {
         result = false;
      }
      else
      {
         DataType dataType = type.getDataType();
         switch (dataType)
         {
            case BOOLEAN:
            {
               result = ((Boolean) value).booleanValue();
               break;
            }

            case CURRENCY:
            case NUMERIC:
            {
               result = !NumberHelper.equals(((Number) value).doubleValue(), 0.0, 0.00001);
               break;
            }

            case DURATION:
            {
               result = (((Duration) value).getDuration() != 0);
               break;
            }

            default:
            {
               break;
            }
         }
      }

      return result;
   }
874203
def p_DefaultValue_string(p):
  """"""
  p[0] = model.Value(type=model.Value.STRING, value=p[1])
460611
def get_default(name, value):
    """"""
    return os.environ.get('EXAMPLE_{}'.format(name.upper()), value)
432196
def default_value(self):
        
        if not hasattr(self, "_default_value"):
            if self.elem_type == "select":
                try:
                    # Get option marked "selected"
                    def_value = get_option_value(self.elem.select_one("[selected]"))
                except AttributeError:
                    # ...or if that one doesen't exist get the first option
                    def_value = get_option_value(self.elem.select_one("option"))

            elif self.elem_type == "checkbox":
                def_value = self.elem.get("value")

            elif self.elem_type == "radio":
                def_value = [x for x in self.elem if x.has_attr("checked")][0].get("value")

            self._default_value = def_value

            assert def_value is not None

        return self._default_value
989838
public boolean isObjectsFieldValueDefault(Object object) throws SQLException {
		Object fieldValue = extractJavaFieldValue(object);
		return isFieldValueDefault(fieldValue);
	}
356683
def get_custom_value(self, field_name):
        
        custom_field = self.get_custom_field(field_name)
        return CustomFieldValue.objects.get_or_create(
            field=custom_field, object_id=self.id)[0].value
494439
def default_value
      match = if definition =~ /timestamp|datetime/i
                /default '?(.+[^'])'?/i.match(definition)
              else
                /default '?(\w+)'?/i.match(definition)
              end

      return unless match

      match[1].downcase != 'null' ? match[1] : nil
    end