Normalize readonly and force options objects.

@param value Raw options.
@return Normalized options.
@static
@private
8529
function normalizeCacheRemote(value: Object|boolean): Object {
  if (value === true || !value) {
    return { cache: !!value, remote: !!value };
  }

  return value;
}
606877
def normalize_value(value):
    
    cast = str
    if six.PY2:
        cast = unicode  # noqa
    return cast(value).lower()
974425
public static Prefer valueOf(final String value) {
        if (value != null) {
            final Map<String, String> data = new HashMap<>();
            final Set<String> params = new HashSet<>();
            stream(value.split(";")).map(String::trim).map(pref -> pref.split("=", 2)).forEach(x -> {
                if (x.length == 2) {
                    data.put(x[0].trim(), x[1].trim());
                } else {
                    params.add(x[0].trim());
                }
            });
            return new Prefer(data.get(PREFER_RETURN), parseParameter(data.get(PREFER_INCLUDE)),
                        parseParameter(data.get(PREFER_OMIT)), params, data.get(PREFER_HANDLING));
        }
        return null;
    }
788170
function(value) {
		"use strict";

		if (!Array.isArray(value)) {
			value = [value];
		}

		return value.map(function(data) {
			if (data === "now") {
				return new Date();
			}
			if (data instanceof Date) {
				return data;
			}
			return false;
		}).filter(function(d) { return d !== false; });
	}
1117838
public static String normalizeWS(String value) {
    char[] tmp = new char[value.length()];
    int pos = 0;
    boolean prevws = false;
    for (int ix = 0; ix < tmp.length; ix++) {
      char ch = value.charAt(ix);
      if (ch != ' ' && ch != '\t' && ch != '\n' && ch != '\r') {
        if (prevws && pos != 0)
          tmp[pos++] = ' ';

        tmp[pos++] = ch;
        prevws = false;
      } else
        prevws = true;
    }
    return new String(tmp, 0, pos);
  }
1228349
function normalizeOptions(optionValue) {
    if (typeof optionValue === "string") {
        return {
            arrays: optionValue,
            objects: optionValue,
            imports: optionValue,
            exports: optionValue,

            // For backward compatibility, always ignore functions.
            functions: "ignore"
        };
    }
    if (typeof optionValue === "object" && optionValue !== null) {
        return {
            arrays: optionValue.arrays || DEFAULT_OPTIONS.arrays,
            objects: optionValue.objects || DEFAULT_OPTIONS.objects,
            imports: optionValue.imports || DEFAULT_OPTIONS.imports,
            exports: optionValue.exports || DEFAULT_OPTIONS.exports,
            functions: optionValue.functions || DEFAULT_OPTIONS.functions
        };
    }

    return DEFAULT_OPTIONS;
}
204572
function(value) {

		var result = false,
			index = this._data_values.indexOf(value);

		if (index != -1) {
			this.removeAt(index);
			result = true;
		}

		return result;

	}
1320111
public function normalizeValue($value)
	{
		if ($value instanceof AbstractNormalization)
		{
			return $value;
		}

		if (is_callable($value))
		{
			return new Custom($value);
		}

		$className = 's9e\\TextFormatter\\Configurator\\TemplateNormalizations\\' . $value;

		return new $className;
	}
404068
public static String asNormalizedStringUnchecked(final Object value) {
    try {
      return asNormalizedString(value);
    } catch (JsonProcessingException e) {
      throw new RuntimeException(e);
    }
  }
65731
public static ConfigParams fromValue(Object value) {
		Map<String, Object> map = RecursiveObjectReader.getProperties(value);
		return new ConfigParams(map);
	}
446581
function normalizeValue(value, info) {
  if (typeof value === 'number') {
    value = String(value)
  } else if (typeof value === 'boolean') {
    value = info.attribute
  } else if (typeof value === 'object' && 'length' in value) {
    value = (info.commaSeparated ? commaSeparated : spaceSeparated)(value)
  }

  return value
}
1163663
function (value) {
            if (this.slice) return;
            if (value === null || typeof value == "undefined")
                value = "";
            this.trueValue = this.formater ? this.formater.format(value) : value;
            //this.element.trueValue = this.trueValue;
            this.showValue = this.masker ? this.masker.format(this.trueValue).value : this.trueValue;
            this.setShowValue(this.showValue);

            //this.trueValue = value;
            //this.showValue = value;
            //this.setShowValue(this.showValue);
        }
62623
public static <T> Position.Readable<T> readOnly(final T value) {
        return readOnly(Validate.notNull(value, "value").getClass(), value);
    }
1033940
function normalizeOptions(obj) {
  for (var key in obj) {
    if (utils.optsKeys.indexOf(key) > -1) {
      obj.options = obj.options || {};
      obj.options[key] = obj[key];
      delete obj[key];
    }
  }
  return obj;
}
50028
public static TypedValue untypedValue(Object value) {
    if (value instanceof TypedValue) {
      return untypedValue(value, ((TypedValue) value).isTransient());
    }
    else return untypedValue(value, false);
  }
1348676
function parse( value, options ) {
	var opts = {};
	if ( arguments.length > 1 ) {
		opts = merge( {}, options );
	}
	opts.sections = true;
	opts.comments = opts.comments || ';';
	opts.separators = '=';
	opts.strict = true;
	return ini( value, opts );
}
957414
function transform(value, options) {
  options = options || {};

  return traverse(value, {
    beforeObject: function(v) {
      if (options.removeFormats &&
          typeof v.format === 'string' &&
          typeof v.type === 'string' &&
          v.type !== 'string') {
        delete v.format;
      }

      return v;
    },
    afterObject: function(v) {
      if (options.convertRefs &&
          typeof v.type === 'string' &&
          constants.notModel.indexOf(v.type) < 0) {
        return { $ref: v.type };
      }

      return v;
    },
  });
}