Parses coordinates from an "x y z" string.
Example: "3 10 -5" to {x: 3, y: 10, z: -5}.

@param {string} val - An "x y z" string.
@param {string} defaults - fallback value.
@returns {object} An object with keys [x, y, z].
512249
function parse (value, defaultVec) {
  var coordinate;
  var defaultVal;
  var key;
  var i;
  var vec;
  var x;
  var y;
  var z;
  var w;

  if (value && value instanceof Object) {
    x = value.x === undefined ? defaultVec && defaultVec.x : value.x;
    y = value.y === undefined ? defaultVec && defaultVec.y : value.y;
    z = value.z === undefined ? defaultVec && defaultVec.z : value.z;
    w = value.w === undefined ? defaultVec && defaultVec.w : value.w;
    if (x !== undefined && x !== null) { value.x = parseIfString(x); }
    if (y !== undefined && y !== null) { value.y = parseIfString(y); }
    if (z !== undefined && z !== null) { value.z = parseIfString(z); }
    if (w !== undefined && w !== null) { value.w = parseIfString(w); }
    return value;
  }

  if (value === null || value === undefined) {
    return typeof defaultVec === OBJECT ? extend({}, defaultVec) : defaultVec;
  }

  coordinate = value.trim().split(whitespaceRegex);
  vec = {};
  for (i = 0; i < COORDINATE_KEYS.length; i++) {
    key = COORDINATE_KEYS[i];
    if (coordinate[i]) {
      vec[key] = parseFloat(coordinate[i], 10);
    } else {
      defaultVal = defaultVec && defaultVec[key];
      if (defaultVal === undefined) { continue; }
      vec[key] = parseIfString(defaultVal);
    }
  }
  return vec;
}
1277366
public static float coerceToFloat(Object value, float defaultValue) {
    if (value instanceof Float) {
      return (float) value;
    }
    if (value instanceof Number) {
      return ((Number) value).floatValue();
    } else if (value instanceof String) {
      try {
        return Float.valueOf((String) value);
      } catch (NumberFormatException ignored) {
      }
    }
    return defaultValue;
  }
53471
function parseValue(expr) {
  switch(expr.kind) {
    case 'array':
      if (expr.items.length === 0) {
        return [];
      }
      var isKeyed = expr.items.every((item) => item.key !== null)
      var items = expr.items.map(parseValue)
      if (isKeyed) {
        items = items.reduce((acc, val) => Object.assign({}, acc, val), {})
      }
      return items
    case 'entry':
      if (expr.key) {
        return { [parseKey(expr.key)]: parseValue(expr.value) }
      }
      return parseValue(expr.value)
    case 'string':
      return expr.value
    case 'number':
      return parseInt(expr.value, 10)
    case 'boolean':
      return expr.value
    default:
      throw new Error(`Unexpected PHP value: "${expr.kind}", details: ${JSON.stringify(expr)}`)
  }
}
1160127
static public function parsePosition($data, $yval=null)
    {
        $x = $y = null;
        if (is_numeric($data)) {
            $data = intval($data);
            if ($data > 0 && $data < 10) {
                if ($data == 1) {
                    $x = static::LEFT;
                    $y = static::TOP;
                } elseif ($data == 2) {
                    $x = static::CENTER;
                    $y = static::TOP;
                } elseif ($data == 3) {
                    $x = static::RIGHT;
                    $y = static::TOP;
                } elseif ($data == 4) {
                    $x = static::LEFT;
                    $y = static::CENTER;
                } elseif ($data == 5) {
                    $x = static::CENTER;
                    $y = static::CENTER;
                } elseif ($data == 6) {
                    $x = static::RIGHT;
                    $y = static::CENTER;
                } elseif ($data == 7) {
                    $x = static::LEFT;
                    $y = static::BOTTOM;
                } elseif ($data == 8) {
                    $x = static::CENTER;
                    $y = static::BOTTOM;
                } else { // 9
                    $x = static::RIGHT;
                    $y = static::BOTTOM;
                }
            } else {
                $x = $data;
            }
        } elseif (is_string($data)) {
            $data = DataHelper::explode('\,\|', $data);
            $x = $data[0];
            if (isset($data[1])) {
                $y = $data[1];
            }
        } elseif (is_array($data)) {
            if (isset($data[0])) {
                $x = $data[0];
            }
            if (isset($data['x'])) {
                $x = $data['x'];
            }
            if (isset($data[1])) {
                $y = $data[1];
            }
            if (isset($data['y'])) {
                $y = $data['y'];
            }
        }
        if (!is_null($yval) && !is_null($y)) {
            $y = $yval;
        }
        
        $x = str_replace(['px', '%'], '', $x);
        $y = str_replace(['px', '%'], '', $y);
        
        if ($x == 'middle') {
            $x = static::CENTER;
        }
        if ($y == 'middle') {
            $y = static::CENTER;
        }
        
        return [$x, $y];
    }
1344079
function parse(value) {
  var values = []
  var input = String(value || empty)
  var index = input.indexOf(comma)
  var lastIndex = 0
  var end = false
  var val

  while (!end) {
    if (index === -1) {
      index = input.length
      end = true
    }

    val = input.slice(lastIndex, index).trim()

    if (val || !end) {
      values.push(val)
    }

    lastIndex = index + 1
    index = input.indexOf(comma, lastIndex)
  }

  return values
}
858835
function parse(value, field, options) {
  options = options || {};
  var parsed = utils.standardizeInput(value);

  // Integer
  if (field.type.key === "BOOLEAN") {
    parsed = utils.toBoolean(parsed);
  }
  else if (field.type.key === "INTEGER") {
    parsed = utils.toInteger(parsed);
  }
  else if (field.type.key === "FLOAT") {
    parsed = utils.toFloat(parsed);
  }
  else if (field.type.key === "DATEONLY") {
    parsed = utils.toDate(parsed, options.dateFormat);
  }
  else if (field.type.key === "DATE") {
    parsed = utils.toDateTime(parsed, options.datetimeFormat);
  }
  else if (field.type.key === "STRING") {
    parsed = utils.toString(parsed);
  }

  return parsed;
}
1220039
function (val) {
		var parseDate = this.options.parseDate,
			ret,
			key,
			format,
			match;

		if (parseDate) {
			ret = parseDate(val);
		}
			
		if (typeof val === 'string') {
			for (key in this.dateFormats) {
				format = this.dateFormats[key];
				match = val.match(format.regex);
				if (match) {
					ret = format.parser(match);
				}
			}
		}
		return ret;
	}
498440
function fromValues(x, y) {
    var out = new Float32Array(2)
    out[0] = x
    out[1] = y
    return out
}
698869
private static Float  parseOpacity(String val)
   {
      try {
         float  o = parseFloat(val);
         return (o < 0f) ? 0f : (o > 1f) ? 1f : o;
      } catch (SVGParseException e) {
         return null;
      }
   }
316818
public static Boolean parseGeneralString(String str, Boolean defaultValue) {
		return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(str), defaultValue);
	}
625059
function parse (val) {
  assert(exists(val), 'Invalid date: ' + val)
  var date = new Date(val)
  assert(!isNaN(date.valueOf()), 'Invalid date: ' + val)
  return date
}
1047482
def parse_value(val):
    
    val = val.replace("%", " ")\
        .replace(" ","")\
        .replace(",", ".")\
        .replace("st","").strip()

    missing = ["Ejdeltagit", "N/A"]
    if val in missing:
        return val
    elif val == "":
        return None

    return float(val)
246736
function defaultsDeep(config, defaults) {
              if (_.isPlainObject(config)) {
                return _.mapValues(_.defaults(config, defaults), function(val, index) {
                  return defaultsDeep(_.get(config, index), _.get(defaults, index));
                });
              }

              return config || defaults;
            }
526508
public String getValueWithDefault(String keyMsgType, String defaultVal) {
        return keyToValue.getOrDefault(keyMsgType, defaultVal);
    }
943839
function(string) {
		var result = String(string);
		switch (result) {
			case "null":
				result = null;
				break;
			case "true":
			case "false":
				result = (result === "true");
				break;
			default:
				if (String(parseInt(result, 10)) === result) {
					result = parseInt(result, 10);
				} else if (String(parseFloat(result)) === result) {
					result = parseFloat(result);
				}
				break;
		}
		return result;
	}
309127
function parseFeatures (features) {
  features = defaultValue(features, '')
  if (!features) {
    return {}
  }

  return features
    .split(',')
    .map(toNameAndValuePair)
    .reduce(toPlainObject, {})
}
527206
public static float getFloat(String name, float defaultVal){
        if(getConfiguration().containsKey(name)){
            return getConfiguration().getFloat(name);
        } else {
            return defaultVal;
        }
    }