recalculates value property
328894
function calc() {
    if (!isValueSet && !areAttrsSet)
      value = slider.getAttribute('value');
    if (!isAttrNum(value))
      value = (min + max) / 2;;
    // snap to step intervals (WebKit sometimes does not - bug?)
    value = Math.round((value - min) / step) * step + min;
    if (value < min)
      value = min;
    else if (value > max)
      value = min + ~~(range / step) * step;
  }
350546
function() {
      var t = this,
          newValue = t.eval_control(t.key, t.depth);

      // Set the new value if it has changed from the current value
      if (!_.isEqual(newValue, t.get('value'))) {
        t.set({value: newValue});
      }
    }
863
function recalculateAllDynamicProperties(entity, properties) {
  // Find all dynamic properties
  _lodash2.default.forEach(properties, function (propertyConfiguration, propertyName) {
    if (isDynamicProperty(propertyConfiguration)) {
      // Recalculate dynamic property value
      var dynamicValue = propertyConfiguration.dynamic(entity);
      // Set updated dynamic value (wrap into EnTTBypassEverythingValue to bypass read-only restriction)
      entity[propertyName] = new _properties.EnTTBypassEverythingValue(dynamicValue);
    }
  });
}
1314506
function(newValue, oldValue, batchNum) {
                    setCached(newValue);
                    updateOnChange(computed, newValue, oldValue, batchNum);
                }
134036
public function recalculateSort()
    {
        $owner = $this->owner;
        $db = $this->owner->getDb();
        $builder = new QueryBuilder($db);

        $orderFields = [$this->sortAttribute => 'asc'];
        foreach ($owner->primaryKey() as $field) {
            if ($field != $this->sortAttribute) {
                $orderFields[$field] = 'asc';
            }
        }
        // recalculate sort
        $query = $builder->update(
            $owner->tableName(),
            [$this->sortAttribute => new Expression('(@sortingCount:=(@sortingCount+1))')],
            $this->getCondition(),
            $params
        ) . ' ' . $builder->buildOrderBy($orderFields);
        $db->createCommand('set @sortingCount=-1;' . $query, $params)->execute();
        // update in current record
        if (!$owner->getIsNewRecord()) {
            $owner->{$this->sortAttribute} = $owner->findOne($owner->getPrimaryKey())->{$this->sortAttribute};
        }
    }
189299
function updateValues(id, withoutStep) {
                if (!withoutStep) {
                    margin = (areaLength - totalLength - itemLength) / 2;
                    if (margin < posMin) {
                        margin = (areaLength - itemLength) / 2;
                        totalLength = 0;
                        step++;
                    }
                }
                steps[id] = step;
                margins[step] = $$.isLegendInset ? 10 : margin;
                offsets[id] = totalLength;
                totalLength += itemLength;
            }
113546
private void appendValueLength(int value, int index) {
    int previousValue = toIntUnsigned(getValue(index));
    int length = toIntUnsigned(getLength(index));
    int offset = value - previousValue;
    if (offset > length) {
      setLength(index, (short) offset);
    }
  }
524354
def value_after(self, x):
        """"""

        try:
            try:
                i = self.all.index(x)
            except ValueError:
                return None

            return self.all[i + 1]

        except IndexError:
            return None
403762
public void recalculateScale() throws SlickException {
		targetWidth = container.getWidth();
		targetHeight = container.getHeight();
		
		if (maintainAspect) {
			boolean normalIsWide = (normalWidth / normalHeight > 1.6 ? true : false);
			boolean containerIsWide = ((float) targetWidth / (float) targetHeight > 1.6 ? true : false);
			float wScale = targetWidth / normalWidth;
			float hScale = targetHeight / normalHeight;

			if (normalIsWide & containerIsWide) {
				float scale = (wScale < hScale ? wScale : hScale);
				targetWidth = (int) (normalWidth * scale);
				targetHeight = (int) (normalHeight * scale);
			} else if (normalIsWide & !containerIsWide) {
				targetWidth = (int) (normalWidth * wScale);
				targetHeight = (int) (normalHeight * wScale);
			} else if (!normalIsWide & containerIsWide) {
				targetWidth = (int) (normalWidth * hScale);
				targetHeight = (int) (normalHeight * hScale);
			} else {
				float scale = (wScale < hScale ? wScale : hScale);
				targetWidth = (int) (normalWidth * scale);
				targetHeight = (int) (normalHeight * scale);
			}

		} 
		
		if (held instanceof InputListener) {
			container.getInput().addListener((InputListener) held);
		}
		container.getInput().setScale(normalWidth / targetWidth,
									  normalHeight / targetHeight);
		

		int yoffset = 0;
		int xoffset = 0;
		
		if (targetHeight < container.getHeight()) {
			yoffset = (container.getHeight() - targetHeight) / 2;
		}
		if (targetWidth < container.getWidth()) {
			xoffset = (container.getWidth() - targetWidth) / 2;
		}
		container.getInput().setOffset(-xoffset / (targetWidth / normalWidth), 
									   -yoffset / (targetHeight / normalHeight));
		
	}
1148440
function(fields, oldValue) {
            fields = this.__resolveFields(fields);

            var prop, key, i, ii;

            this.__checkEmitEvent(true);

            if (_.isSimpleObject(oldValue)) {
                for (key in oldValue) {
                    this.__emitPropertyRemove(fields.concat(key), oldValue[key]);
                }
            }
            else if (_.isArray(oldValue)) {
                for (i = 0, ii = oldValue.length; i < ii; ++i) {
                    this.__emitPropertyRemove(fields.concat(i), oldValue[i]);
                }
            }

            prop = fields.join('.');

            this.__emitEvent('property.' + prop + '.clear', oldValue);
            this.__emitEvent('property.clear', prop, oldValue);

            return this;
        }
1272659
function getter (value, properties) {
  // Most calculations happen within the typecast and the value passed is typically the value we want to use.
  // Typically, the getter just returns the value.
  // Modifications to the value within the getter are not written to the object.

  // Getter can transform value after typecast.
  if (properties.get) {
    value = properties.get.call(this, value)
  }

  return value
}
1267723
function() {

		var new_value = this._evaluate(),
			event_args;

		if (new_value !== this._value) {

			event_args = {old_value: this._value};
			this._value = new_value;
			this._fire('changed', event_args);

		}

	}
448901
function mutablePropertyChange(inst, property, value, old, mutableData) {
  let isObject;
  if (mutableData) {
    isObject = (typeof value === 'object' && value !== null);
    // Pull `old` for Objects from temp cache, but treat `null` as a primitive
    if (isObject) {
      old = inst.__dataTemp[property];
    }
  }
  // Strict equality check, but return false for NaN===NaN
  let shouldChange = (old !== value && (old === old || value === value));
  // Objects are stored in temporary cache (cleared at end of
  // turn), which is used for dirty-checking
  if (isObject && shouldChange) {
    inst.__dataTemp[property] = value;
  }
  return shouldChange;
}
707938
function (object, property, value) {
        if (object[OBSERVER_PROPERTY]) {
            var exists = ownProperty.call(object, property), oldVal = object[property], sz1 = object.length, chgset=null;
            object[property] = value;

            if (!exists) {
                chgset=[changeDesc(object, property, value, oldVal, "new")];
            } else if (oldVal !== value) {
                // do nothing if the value did not change or was not created:
                chgset=[changeDesc(object, property, value, oldVal, "updated")];
            }
            if (object.constructor === Array) {
                var sz2 = object.length;
                if (sz1 !== sz2) {
                    if (!chgset) {
                        chgset=[];
                    }
                    chgset.push(changeDesc(object, "length", sz2, sz1, "updated"));
                }
            }
            if (chgset) {
                callObservers(object, chgset);
            }
        } else {
            object[property] = value;
        }
        return value;
    }
906868
def _transform_value(self, instance, counter_id, value):
        
        i_key = self._instance_key(instance)
        try:
            metadata = self.metadata_cache.get_metadata(i_key, counter_id)
            if metadata["unit"] == "percent":
                return float(value) / 100
        except MetadataNotFoundError:
            pass

        # Defaults to return the value without transformation
        return value
655951
function fixNestedCalc(value) {
    const reCalcVal = /calc\(([^)]+)\)/g;

    (value.match(reCalcVal) || []).forEach(match => {
        const newVal = `calc${match.split('calc').join('')}`;
        value = value.replace(match, newVal);
    });

    return value;
}
303298
def updateCurrentValue(self, value):
        
        try:
            method = getattr(self._targetObject, self._setter)
        except AttributeError:
            return
        
        try:
            method(unwrapVariant(value))
        except:
            return