Returns an object equal to the external form of the given value.
166045
public static Object toExternalObject( Object value)
    {
    return
      Optional.ofNullable(
        toExternalNumber( value))
      .orElse(
        toObject( String.valueOf( value)));
    }
235234
def value_from_object(self, obj):
        """"""
        val = super(JSONField, self).value_from_object(obj)
        return self.get_prep_value(val)
735109
function (value) {

            var options = $('option', this.$select);
            var valueToCompare = value.toString();

            for (var i = 0; i < options.length; i = i + 1) {
                var option = options[i];
                if (option.value === valueToCompare) {
                    return $(option);
                }
            }
        }
1197551
def to_internal_value_single(self, data, serializer):
        """"""
        related_model = serializer.Meta.model
        if isinstance(data, related_model):
            return data
        try:
            instance = related_model.objects.get(pk=data)
        except related_model.DoesNotExist:
            raise ValidationError(
                "Invalid value for '%s': %s object with ID=%s not found" %
                (self.field_name, related_model.__name__, data)
            )
        return instance
1013756
private function makeReal($value)
    {
        if (is_array($value)) {
            foreach ($value as $key => $val) {
                $value[$key] = $this->makeReal($val);
            }
        }

        if ($value instanceof ObjectStub) {
            return $value->getObject();
        }

        return $value;
    }
387622
function ( value ) {
            var result = false;
    
            switch ( this.type(value) ) {
                case 'Object':
                    result = true;
                    for ( var key in value ) {
                        result = false;
                        break;
                    }
                    break;
                case 'Array':
                    result = value.length === 0;
                    break;
                case 'Null':
                    result = true;
                    break;
                case 'Undefined':
                    result = true;
                    break;
                case 'String':
                    result = '' === value;
                    break;
            }
    
            return result;
        }
489817
def assign_to(self, value):
        
        if value == None or len(self) == 0:
            return

        RecursiveObjectWriter.copy_properties(value, self)
245269
function(value) 
	{
		if (value == undefined) return conbo.identity;
		if (conbo.isFunction(value)) return value;
		return conbo.property(value);
	}
996566
def equal_to(self, key, value):
        
        self._where[key] = utils.encode(value)
        return self
23597
public static Double getAsDouble(Object value) {
		Double result = null;

		try {
			if (value instanceof String) {
				result = Double.valueOf((String) value);
			} else if (value instanceof Number) {
				result = ((Number) value).doubleValue();
			} else {
				result = null;
			}
		} catch (Exception e) {
			result = null;
		}

		return result == null ? 0 : result;
	}
910745
def wrap(self, value):
        ''' 
        '''
        self.validate_wrap(value)
        ret = {}
        for k, v in value.items():
            ret[k] = self.value_type.wrap(v)
        return ret
1141484
def eq_(self, value):
        ''' 
        '''
        if isinstance(value, QueryField):
            return self.__cached_id == value.__cached_id
        return QueryExpression({ self : self.get_type().wrap_value(value) })
694441
def formvalue (form, key):
    """"""
    field = form.get(key)
    if isinstance(field, list):
        field = field[0]
    return field
577979
def _get_val(other):
    
    assert isinstance(other, (numbers.Number, SymbolNUMBER, SymbolCONST))
    if isinstance(other, SymbolNUMBER):
        return other.value

    if isinstance(other, SymbolCONST):
        return other.expr.value

    return other
599412
def coerce(value, object, type)
      return value if value.nil?

      if type.is_a?(Enumerable)
        objects = value.map { |e| coerce(e, object, type.first) }
        if type.respond_to?(:find_by)
          return type.class.new({}).populate(objects)
        else
          return type.class.new(objects)
        end
      elsif type.ancestors.include? Flickr::Object
        return type.new(value, object.access_token)
      else
        COERCIONS.fetch(type).each do |coercion|
          begin
            return coercion.call(value)
          rescue
          end
        end
      end

      value
    end
302176
def coerce(self, value):
        """"""
        if self._coerce is not None:
            value = self._coerce(value)
        return value
659362
function(value) {
        switch (values.typeOf(value)) {
            case 'Null':
            case 'Boolean':
            case 'String':
            case 'Number':
                return value;

            case 'RegExp':
                return String(value);

            case 'Date':
            case 'Duration':
                return value.valueOf();

            case 'Filter':
                return value.source;

            case 'Array':
                return _.map(value, this.toJSONCompatible, this);

            case 'Object':
                return _.mapObject(value, this.toJSONCompatible, this);
        }
    }