we return the defaultValue.
768821
Formatter getFormatterProperty(String name, Formatter defaultValue) {
        String val = getProperty(name);
        try {
            if (val != null) {
                return (Formatter) getClassInstance(val).newInstance();
            }
        } catch (Exception ex) {
            // We got one of a variety of exceptions in creating the
            // class or creating an instance.
            // Drop through.
        }
        // We got an exception.  Return the defaultValue.
        return defaultValue;
    }
1125352
function defaultValue (key) {
    if (!checkAllAliases(key, flags.bools) &&
        !checkAllAliases(key, flags.counts) &&
        `${key}` in defaults) {
      return defaults[key]
    } else {
      return defaultForType(guessType(key))
    }
  }
519586
private String defaultPrimitiveValue(Class<?> clazz){
		
		return clazz == byte.class  || 
			   clazz == short.class || 
			   clazz == int.class? "0":
			   clazz == long.class? "0L":
			   clazz == float.class? "0.0f":
			   clazz == double.class? "0.0d":
			   clazz == char.class ? "'\u0000'":
			   clazz == boolean.class ? "false":
			   "null";
					   
	}
1101735
def defaults(values={}):
    """"""
    if values: return values
    save_types = basestring, int, float, tuple, list, dict, type(None)
    for k, v in globals().items():
        if isinstance(v, save_types) and not k.startswith("_"): values[k] = v
    return values
767850
public function getValue() : ?string 
    {
        if ( ! $this->hasValue()) {
            $this->setValue($this->getDefaultValue());
        }
        return $this->value;
    }
382738
@CanIgnoreReturnValue // TODO(kak): Consider removing this?
  @Nullable
  public static <T> T getOnlyElement(Iterator<? extends T> iterator, @Nullable T defaultValue) {
    return iterator.hasNext() ? getOnlyElement(iterator) : defaultValue;
  }
563133
def default_value(self):
        
        if self.has_default:
            if hasattr(self.default, '__call__'):
                return self.default()
            else:
                return self.default
        else:
            raise Exception("No default value specified")
1014878
public String get(String key, String defaultValue) {
		addToDefaults(key, defaultValue);
		String value = get(key);
		if (value == null) {
			return defaultValue;
		} else {
			return value;
		}
	}
703637
private function normalizeDefault()
    {
        if ($this->hasDefaultValue()) {
            if (preg_match('/^\'?(.*?)\'?::(.+)/', $this->defaultValue, $matches)) {
                //In database: 'value'::TYPE
                $this->defaultValue = $matches[1];
            } elseif ($this->type == 'bit') {
                $this->defaultValue = bindec(
                    substr($this->defaultValue, 2, strpos($this->defaultValue, '::') - 3)
                );
            } elseif ($this->type == 'boolean') {
                $this->defaultValue = (strtolower($this->defaultValue) == 'true');
            }

            if ($this->getType() == self::FLOAT || $this->getType() == self::INT) {
                if (preg_match('/^\(?(.*?)\)?(?!::(.+))?$/', $this->defaultValue, $matches)) {
                    //Negative numeric values
                    $this->defaultValue = $matches[1];
                }

                return;
            }
        }
    }
256519
public function getDefaultValue()
    {
        if (1 != $this->parameters->get('defaultValueIsNull')) {
            $defaultValue = $this->parameters->get('defaultValue');
            if (strlen($defaultValue) && 'NULL' != $defaultValue) {
                return trim($defaultValue, '\'"');
            }
        }
    }
798733
def default(self):
        """"""
        if self.MUTABLE:
            return copy.deepcopy(self._default)
        else:
            return self._default
1098640
@SuppressWarnings("unchecked")
    public final T first(T defaultValue) {
        if (this instanceof Callable) {
            return checkedCall((Callable<T>) this);
        }
        Iterator<T> it = iterator();
        if (it.hasNext()) {
            return it.next();
        }
        return defaultValue;
    }
1276433
private CodeBlock getDefaultValue(Property prop, FieldSpec field) {
    if (field.type.isPrimitive()) {
      String defaultValue = getDefaultPrimitiveValue(field.type);
      if (defaultValue != null) {
        return CodeBlock.of("$L", defaultValue);
      } else {
        return CodeBlock.of("$T.valueOf(null)", field.type);
      }
    }
    if (prop.nullable()) {
      return null;
    }
    TypeMirror type = prop.element.getReturnType();
    if (type.getKind() != TypeKind.DECLARED) {
      return null;
    }
    TypeElement typeElement = MoreTypes.asTypeElement(type);
    if (typeElement == null) {
      return null;
    }

    return null;
  }
973865
function(value, defaultValue) {
      var result = value === undefined || value === null ? defaultValue : value;

      return result;
    }
443843
def get_default_val(self):
        """"""
        val = self.default
        while callable(val):
            val = val()
        return val
890542
def get_default(self):
    

    if self.default is not NotImplemented:
      return self.default
    elif self.default_factory is not None:
      return self.default_factory()
    else:
      raise RuntimeError('{0!r} has no default value'.format(self.full_name))
530761
public Object getJavaDefaultValueDefault() {
		if (field.getType() == boolean.class) {
			return DEFAULT_VALUE_BOOLEAN;
		} else if (field.getType() == byte.class || field.getType() == Byte.class) {
			return DEFAULT_VALUE_BYTE;
		} else if (field.getType() == char.class || field.getType() == Character.class) {
			return DEFAULT_VALUE_CHAR;
		} else if (field.getType() == short.class || field.getType() == Short.class) {
			return DEFAULT_VALUE_SHORT;
		} else if (field.getType() == int.class || field.getType() == Integer.class) {
			return DEFAULT_VALUE_INT;
		} else if (field.getType() == long.class || field.getType() == Long.class) {
			return DEFAULT_VALUE_LONG;
		} else if (field.getType() == float.class || field.getType() == Float.class) {
			return DEFAULT_VALUE_FLOAT;
		} else if (field.getType() == double.class || field.getType() == Double.class) {
			return DEFAULT_VALUE_DOUBLE;
		} else {
			return null;
		}
	}