Revert specified property to default value

        If no property is specified, all properties are returned to default.
552336
def _reset(self, name=None):
        
        if name is None:
            for key in self._props:
                if isinstance(self._props[key], basic.Property):
                    self._reset(key)
            return
        if name not in self._props:
            raise AttributeError("Input name '{}' is not a known "
                                 "property or attribute".format(name))
        if not isinstance(self._props[name], basic.Property):
            raise AttributeError("Cannot reset GettableProperty "
                                 "'{}'".format(name))
        if name in self._defaults:
            val = self._defaults[name]
        else:
            val = self._props[name].default
        if callable(val):
            val = val()
        setattr(self, name, val)
125367
def reset(self):
        
        for i in range(len(self.values)):
            self.values[i].delete(0, tk.END)

            if self.defaults[i] is not None:
                self.values[i].insert(0, self.defaults[i])
1286672
private void resetDefaults( TableView tView ) {
        Object[] colNames = tView.getColNames();
        Object[][] tableValues = tView.getCalcdValues();
        // dumpObjs( tableValues, System.out);
        JTable table = new JTable( tableValues, colNames );
        tView.setViewColumnsWidth( table );
        setTitle( tView.getViewTitle() );
        //
        if ( mainSP != null ) getContentPane().remove( mainSP );
        mainSP = new JScrollPane( table );
        getContentPane().add( mainSP, "Center" );
        validate();
    }
860995
def reset_to_defaults(self, save=True, verbose=False, section=None):
        
        for sec, options in self.defaults:
            if section == None or section == sec:
                for option in options:
                    value = options[ option ]
                    self._set(sec, option, value, verbose)
        if save:
            self._save()
438217
def setDefault(self, key, value):
        
        if value is None:
            self._defaults.pop(key, None)
        else:
            self._defaults[key] = value
485768
@SuppressWarnings("unchecked")
    public A replace(Property property) {
        Data data = getData();
        Data replaced = data.replace(property);
        if (!replaced.isEmpty()) {
            return copy(delegate.put("data", Property.toArrayNode(replaced)));
        }
        return (A)this;
    }
1036599
public final void revert() {
        if (isBuffering()) {
            if (logger.isDebugEnabled()) {
                logger.debug("Reverting buffered value '" + getValue() + "' to value '" + wrappedModel.getValue() + "'");
            }
            setValue(wrappedModel.getValue());
        }
        else {
            if (logger.isDebugEnabled()) {
                logger.debug("No buffered edit to commit; nothing to do...");
            }
        }
    }
407097
def ver(self, value):
        
        if value == self._defaults['ver'] and 'ver' in self._values:
            del self._values['ver']
        else:
            self._values['ver'] = value
289956
def _reset_lazy_properties(self):
        """"""

        for key, value in self.__class__.__dict__.items():
            if isinstance(value, lazyproperty):
                self.__dict__.pop(key, None)
179231
public void restoreFieldProperties(PropertiesField fldProperties)
    {
        if (fldProperties == null)
            return;
        try {
            // This may seem a little wierd, but by doing this, I won't change the field if there was no change.
            Map<String,Object> properties = fldProperties.getProperties();
            this.close();
            while (this.hasNext())
            {
                this.next();
                String strKey = this.getField(PropertiesInput.KEY).getString();
                String strValue = this.getField(PropertiesInput.VALUE).getString();
                if (strValue != null)
                    if (strValue.length() > 0)
                {
                    fldProperties.setProperty(strKey, strValue);
                    properties.remove(strKey);
                }
            }
            Iterator<String> iterator = properties.keySet().iterator();
            while (iterator.hasNext())
            {
                String strKey = iterator.next();
                fldProperties.setProperty(strKey, null);
            }
        } catch (DBException ex) {
            ex.printStackTrace();
        }
    }
796769
def to_map_with_default(value, default_value):
        
        result = RecursiveMapConverter.to_nullable_map(value)
        return result if result != None else default_value
86306
public static AlluxioProperties defaults() {
    if (sDefaultProperties == null) {
      synchronized (DEFAULT_PROPERTIES_LOCK) { // We don't want multiple threads to reload
        // properties at the same time.
        // Check if properties are still null so we don't reload a second time.
        if (sDefaultProperties == null) {
          reloadProperties();
        }
      }
    }
    return sDefaultProperties.copy();
  }
72990
def removeProperty(self, prop: str) -> str:
        """"""
        removed_prop = self.get(prop)
        # removed_prop may be False or '', so need to check it is None
        if removed_prop is not None:
            del self[prop]
        return removed_prop
742256
public void resetProperty(T property)
    {
        String propertyName = getTranslator().getPropertyName(property);

        if (properties.resetToDefault(propertyName))
        {
            firePropertyReset(property);
        }
    }
973865
function(value, defaultValue) {
      var result = value === undefined || value === null ? defaultValue : value;

      return result;
    }
587293
@Override
    public void unset(String propName) {
        if (propName.equals("deleteDescendants")) {
            unsetDeleteDescendants();
        }
        if (propName.equals("returnDeleted")) {
            unsetReturnDeleted();
        }
        super.unset(propName);
    }
1144196
protected function _setPropertyValue($property, $value)
    {
        //if a value is null and it's requires set it to the default
        //value
        $property = $this->_description->getProperty($property);
        $name = $property->getName();

        if ($property->isAttribute()) {
            $default = $property->getDefaultValue();

            if ($value === null && $default) {
                $value = $default;
            }
        }

        $this->_property[$name] = $value;
        $this->_materialized[$name] = $name;
    }