Append default unit to value if value is a unit

@param {string|number} value
@param {string|number} property
@return {string}
435126
function unit(value, property) {
	let ignored = ['font-weight', 'opacity', 'content', 'columns', 'column-count'];

	if (ignored.includes(property) || property === false || value === 0 || /\s/.test(value)) {
		return value.toString();
	}

	if (! isUnit(value) && isNumber(value)) {
		if (property === 'line-height') {
			value += units.lineHeight;
		} else {
			value += units.default;
		}
	}

	return value;
}
981922
function $value(value) {
      function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }
      function $replace(value) {
        var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });
        return replacement.length ? replacement[0] : value;
      }
      value = $replace(value);
      return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);
    }
372655
public int addValue(String property, String value) {
		int count = 0;
		for (String geoPackage : propertiesMap.keySet()) {
			if (addValue(geoPackage, property, value)) {
				count++;
			}
		}
		return count;
	}
645093
function( value ) {
      var result = (value === undefined || value === null || value === "" || (value.hasOwnProperty("length") && value.length == 0));

      return result;
    }
127541
function format(value, unitInfo) {
  const unit = unitInfo.unit;
  const precision = unitInfo.precision || 0;
  let v = 0;
  switch (unit) {
    case 'GB':
      v = value / GB;
      break;
    case 'MB':
      v = value / MB;
      break;
    default:
      v = value;
      break;
  }
  v = parseFloat(Number(v).toFixed(precision));
  return v;
}
1323328
function(value, unit){
		if (typeOf(value) != 'fx:css:value') value = this.parse(value);
		var returned = [];
		value.each(function(bit){
			returned = returned.concat(bit.parser.serve(bit.value, unit));
		});
		return returned;
	}
343319
function Property (initValue) {
		if (arguments.length) {
			this.set(initValue);
		}
		else {
			this.set(this.defaultValue);
		}
		ok.Data.apply(this, arguments);
	}
475836
def unit_value(self, value):
        

        if isinstance(value, TimeUnit):
            self._unit = value
        else:
            self._unit = TimeUnit(value)
761124
function separateValue (property, value) {
                            var unitType,
                                numericValue;

                            numericValue = (value || 0)
                                .toString()
                                .toLowerCase()
                                /* Match the unit type at the end of the value. */
                                .replace(/[%A-z]+$/, function(match) {
                                    /* Grab the unit type. */
                                    unitType = match;

                                    /* Strip the unit type off of value. */
                                    return "";
                                });

                            /* If no unit type was supplied, assign one that is appropriate for this property (e.g. "deg" for rotateZ or "px" for width). */
                            if (!unitType) {
                                unitType = CSS.Values.getUnitType(property);
                            }

                            return [ numericValue, unitType ];
                        }
1332874
public static String setProperty(String value, String defValue) {
        if (value != null && !"".equals(value)) {
            return value;
        }
        return defValue;
    }
860809
function UnitCode(unitCode) {
	switch (typeof unitCode) {
	case "string":
		unitCode = parseInt(unitCode, 10);
		if (unitCode || unitCode === 0) {
			var index = unitCode - 1;
			if ((index >= 0) && (index <= (deviceCodes.length - 1))) {
				this.raw = deviceCodes[index];
			} else {
				throw new Error("Unit code string out of range.");
			}
		} else {
			throw new Error("Invalid unit code.");
		}
		break;
	default:
		if (deviceCodes.indexOf(unitCode) !== -1) {
			this.raw = unitCode;
		} else {
			throw new Error("Unit code number out of range.");
		}
		break;
	}
	return this.raw;
}
691074
private void appendValue(Object value) {
        if (value == null) {
            append("null");
        } else if (value instanceof MwsObject) {
            append("{");
            needComma = false;
            ((MwsObject) value).writeFragmentTo(this);
            append("}");
        } else if (value instanceof Boolean || value instanceof Number) {
            append(value.toString());
        } else if (value instanceof String) {
            append("\"");
            escape((String) value);
            append("\"");
        } else if (value instanceof Node) {
            appendValue(MwsUtl.toXmlString((Node) value));
        } else if (value instanceof XMLGregorianCalendar) {
            append(((XMLGregorianCalendar) value).toXMLFormat());
        } else if (value instanceof Enum) {
            append(value.toString());
        } else {
            throw new IllegalArgumentException("Unsupported type "+value.getClass().getName());
        }
        needComma = true;
    }
1301662
function pxValue(val, options) {
  if (!options) {
    options = {};
  }

  const baseFontSize = parseInt(prop(options, 'base-font-size', 16), 10);

  const value = parseFloat(val);
  const unit = val.replace(value, '');
  // eslint-disable-next-line default-case
  switch (unit) {
    case 'rem':
    case 'em':
      return value * baseFontSize;
    case 'pt':
      return value / (96 / 72);
    case 'px':
      return value;
  }

  throw new Error('The unit ' + unit + ' is not supported');
}
1107850
def __set_unit(self, value):
        '''
        
        '''
        if value in UNITS:
            value = value.upper()

        self.__unit = value
1037977
function nonenum(object, propertyName, defaultValue) {
	var value = object[propertyName];

	if (typeof value === 'undefined') {
		value = defaultValue;
		Object.defineProperty(object, propertyName, {
			enumerable: false,
			value: value
		});
	}

	return value;
}
1315619
def wrap(cls, value):
        ''' 

        '''
        if isinstance(value, dict):
            if isinstance(value, PropertyValueColumnData):
                return value
            else:
                return PropertyValueColumnData(value)
        else:
            return value
1344469
function convertAdditionalProperties (data, additionalProperties) {
  if (additionalProperties !== undefined) {
    let val = data
    if (typeof additionalProperties === 'boolean') val = additionalProperties
    if (typeof additionalProperties === 'object' && Object.keys(additionalProperties).length === 0) val = true
    if (typeof additionalProperties === 'object' && Object.keys(additionalProperties).length > 0) {
      const type = additionalProperties.type
      data.properties['//'] = { type: type }
      val = false
    }
    data.additionalProperties = val
  }
  return data
}