Evaluates the default value given, this is used by undump
 when determining the value of the default given for a field options.

 @param [Object] :value the attribute's default value
182126
def evaluate_default_value(val)
      if val.respond_to?(:call)
        val.call
      elsif val.duplicable?
        val.dup
      else
        val
      end
    end
805251
function resolveValueOrNodeSkel(index, val, valDefault) {
    switch (typeof(val)) {
      case "string":
        return resolveNodeSkel(index, val);
      case "undefined":
        if (valDefault === undefined) {
          throw "Unable to get value'" + val + "'";
        }
        return () => valDefault;
      default:
        return () => val;
    }
  }
820295
public void annotateDefaultValueLater(JCExpression defaultValue, Env<AttrContext> localEnv,
            MethodSymbol m, DiagnosticPosition deferPos)
    {
        normal(() -> {
            JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
            DiagnosticPosition prevLintPos = deferredLintHandler.setPos(deferPos);
            try {
                enterDefaultValue(defaultValue, localEnv, m);
            } finally {
                deferredLintHandler.setPos(prevLintPos);
                log.useSource(prev);
            }
        });

        validate(() -> { //validate annotations
            JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
            try {
                // if default value is an annotation, check it is a well-formed
                // annotation value (e.g. no duplicate values, no missing values, etc.)
                chk.validateAnnotationTree(defaultValue);
            } finally {
                log.useSource(prev);
            }
        });
    }
1157206
def get_defaults_values(options = {})
      defaults_ = {}
      options[:columns].each do |column, config|
        defaults_[column.to_s] = @columns[column.to_sym][:default] || nil
      end
      defaults_
    end
570444
def value=(value)
      case tag_name
      when "textarea"
        @_node.setText("")
        type(value)
      when "input"
        if file_input?
          @_node.setValueAttribute(value)
        else
          @_node.setValueAttribute("")
          type(value)
        end
      end
    end
951283
function(opt, field_name, default_value) {
    if(typeof field_name === 'string') {
      // case of single string
      return (typeof opt[field_name] !== 'undefined') ? opt[field_name] : default_value;
    } else {
      // assume we are given a list of string instead
      var ret = default_value;
      for(var i=0;i<field_name.length;i++) {
        var f = field_name[i];
        if (typeof opt[f] !== 'undefined') {
          ret = opt[f]; // overwrite return value
        }
      }
      return ret;
    }
  }
878606
def validate_value(self, value):
        
        field = self.instance.preference.setup_field()
        value = field.to_python(value)
        field.validate(value)
        field.run_validators(value)
        return 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
54713
def valid?(value, negated = false)
      dumped_value = dump(value)

      if required? && dumped_value.nil?
        negated || false
      else
        value_dumped?(dumped_value) || (dumped_value.nil? && (allow_nil? || negated))
      end
    end
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
774560
def option(key, *value)
      if value.empty?
        value = options[key]
        value = value[0] if value && value.size == 1
        value
      else
        options(key => value)
      end
    end
1252362
def default_options
        if Object.const_defined?('Rails')
          {
            :file   => Rails.root.join('config', 'config.yml'),
            :reload => Rails.env.development?,
            :env    => Rails.env
          }
        else
          {
            :file   => File.expand_path("config.yml"),
            :reload => false,
            :env    => "development"
          }
        end
      end
768615
def apply_default(name)
      unless attributes.key?(name)
        if field = fields[name]
          default = field.eval_default(self)
          unless default.nil? || field.lazy?
            attribute_will_change!(name)
            attributes[name] = default
          end
        end
      end
    end
386966
def _evaluate_priority_nil
      # Need to specify value explicitly here, otherwise in the call to
      # _evaluate_priority, the case statement won't recognize it as a Symbol.
      # That's because when calls Symbol::=== to evaluate a match.
      priority = config.default_priority

      if priority
        _evaluate_priority(priority)
      else
        raise Errors::InvalidPriorityError, priority.inspect
      end
    end
291527
def dump_value(value)
      case value
      when Array
        # dump recursively
        value.map { |v| dump_value v }
      when String
        replace_interpolations value
      end
    end
1244518
def default_backend=(value)
      raise ArgumentError, "default_backend must be a symbol!" unless value.is_a? Symbol

      unless @backends.keys.include? value
        raise ArgumentError, "Unregistered backend cannot be set as default!"
      end

      @default_backend = value
    end
176704
function(key, value, options) {
      var attrs, attr, val;

      // Handle both `"key", value` and `{key: value}` -style arguments.
      if (_.isObject(key) || key == null) {
        attrs = key;
        options = value;
      } else {
        attrs = {};
        attrs[key] = value;
      }

      // Extract attributes and options.
      options || (options = {});
      if (!attrs) return this;
      if (attrs instanceof Model) attrs = attrs.attributes;
      if (options.unset) for (attr in attrs) attrs[attr] = void 0;

      // Run validation.
      if (!this._validate(attrs, options)) return false;

      // Check for changes of `id`.
      if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];

      var changes = options.changes = {};
      var now = this.attributes;
      var escaped = this._escapedAttributes;
      var prev = this._previousAttributes || {};

      // For each `set` attribute...
      for (attr in attrs) {
        val = attrs[attr];

        // If the new and current value differ, record the change.
        if (!_.isEqual(now[attr], val) || (options.unset && _.has(now, attr))) {
          delete escaped[attr];
          (options.silent ? this._silent : changes)[attr] = true;
        }

        // Update or delete the current value.
        options.unset ? delete now[attr] : now[attr] = val;

        // If the new and previous value differ, record the change.  If not,
        // then remove changes for this attribute.
        if (!_.isEqual(prev[attr], val) || (_.has(now, attr) != _.has(prev, attr))) {
          this.changed[attr] = val;
          if (!options.silent) this._pending[attr] = true;
        } else {
          delete this.changed[attr];
          delete this._pending[attr];
        }
      }

      // Fire the `"change"` events.
      if (!options.silent) this.change(options);
      return this;
    }