Generates a clone of the current value stored for the preference with
 the given name / group
961265
def clone_preference_value(name, group)
        value = preferred(name, group)
        value.duplicable? ? value.clone : value
      rescue TypeError, NoMethodError
        value
      end
1002575
def clone(self, **kwargs):
        """"""
        init_kwargs = {
            "name": self.__name,
            "dataframe": self.__df,
            "include_columns": self.__include_columns,
            "include_index": self.__include_index,
            "style": self.__style,
            "column_styles": self.__col_styles,
            "column_widths": self.__column_widths,
            "row_styles": self.__row_styles,
            "header_style": self.header_style,
            "index_style": self.index_style
        }
        init_kwargs.update(kwargs)
        return self.__class__(**init_kwargs)
1066817
def _clone(self, **attrs):
        

        with xact():
            # Gather objs we'll need save after
            old_m2ms = self._gather_m2ms()
            old_reverses = self._gather_reverses()

            for k, v in attrs.items():
                setattr(self, k, v)

            # Do the clone
            self.prep_for_clone()
            self.validate_unique()
            # Prevent last save from changing
            self.save(last_save=self.last_save)

            # save m2ms
            self._set_m2ms(old_m2ms)
            # Prevent last save from changing
            self.save(last_save=self.last_save)

            # save reverses
            self._clone_reverses(old_reverses)
547256
private void chkSameAsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkSameAsActionPerformed
        preference.put(OntopOBDASettings.SAME_AS, String.valueOf(chkSameAs.isSelected()));

    }
379255
function cloneIt2(o) {
	let keys = Object.keys(o);
	let current = o;
	const acc = {};
	let currentAcc = acc;

	let i = 0;
	let iMax = keys.length + 1;
	let previous = [];
	let activeKey = [];

	for (; i < iMax; i++) {
		if (i === iMax - 1) {
			if (!previous.length) {
				break;
			}

			const prev = previous.pop();
			activeKey.pop();

			i = prev.i;
			iMax = prev.iMax;
			keys = prev.keys;

			let j = 0;
			const jMax = activeKey.length;
			currentAcc = acc;
			current = o;

			for (; j < jMax; j++) {
				currentAcc = currentAcc[activeKey[j]];
				current = current[activeKey[j]];
			}
		} else if (typeof current[keys[i]] === 'object') {
			currentAcc[keys[i]] = {};

			previous.push({ i, iMax, keys });
			activeKey.push(keys[i]);
			current = current[keys[i]];
			currentAcc = currentAcc[keys[i]];
			i = -1;
			keys = Object.keys(current);
			iMax = keys.length + 1;
		} else {
			currentAcc[keys[i]] = current[keys[i]];
		}
	}

	return acc;
}
786435
def copy(self, **replacements):
    """"""
    cls = type(self)
    kwargs = {'org': self.org, 'name': self.name, 'ext': self.ext, 'classifier': self.classifier, 'rev': self.rev}
    for key, val in replacements.items():
      kwargs[key] = val
    return cls(**kwargs)
1341939
function repeat_elements_fix_clone($i, $elementclone, &$namecloned) {
        $name = $elementclone->getName();
        $namecloned[] = $name;

        if (!empty($name)) {
            $elementclone->setName($name."[$i]");
        }

        if (is_a($elementclone, 'HTML_QuickForm_header')) {
            $value = $elementclone->_text;
            $elementclone->setValue(str_replace('{no}', ($i+1), $value));

        } else if (is_a($elementclone, 'HTML_QuickForm_submit') || is_a($elementclone, 'HTML_QuickForm_button')) {
            $elementclone->setValue(str_replace('{no}', ($i+1), $elementclone->getValue()));

        } else {
            $value=$elementclone->getLabel();
            $elementclone->setLabel(str_replace('{no}', ($i+1), $value));
        }
    }
1341408
function _clone(value) {
  if(value && typeof value === 'object') {
    var rval;
    if(_isArray(value)) {
      rval = [];
      for(var i = 0; i < value.length; ++i) {
        rval[i] = _clone(value[i]);
      }
    }
    else {
      rval = {};
      for(var key in value) {
        rval[key] = _clone(value[key]);
      }
    }
    return rval;
  }
  return value;
}
758908
function () {
			
			var i, j, ilength, jlength, currentSubChoices, currentSubChoice, currentValue,
			    testValue, isDuplicateChoice, secondSelectChoices;
			
			
			// object used in updateSecondSelectChoices
			//
			//   * key   : string representing a value in 1st select
			//   * value : array of values available in 2nd select when key is selected in first select
			//
			this.valuesMatching = {};
			
			
			// helper to filter 2nd select choices to find duplicates
			isDuplicateChoice = function(elt, arrElt) {
				elt    = lang.isObject(elt)    ? elt.value    : elt;
				arrElt = lang.isObject(arrElt) ? arrElt.value : arrElt;
				return elt === arrElt;
			};
			
			// collect 2nd level choices + ensure uniqueness of values
			secondSelectChoices = [];
			
			for (i = 0, ilength = this.options.choices.length; i < ilength; i += 1) {
				
				currentValue = lang.isObject(this.options.choices[i]) ? this.options.choices[i].value : this.options.choices[i];
				currentSubChoices = this.options.choices[i].choices;
				
				this.valuesMatching[currentValue] = [];
				
				// maybe no sub choices ???
				if (currentSubChoices) {
					for (j = 0, jlength = currentSubChoices.length; j < jlength; j += 1) {
					
						currentSubChoice = currentSubChoices[j];
					
						testValue = lang.isObject(currentSubChoice) ? currentSubChoice.value : currentSubChoice;
					
						this.valuesMatching[currentValue].push(testValue);
					
						if (inputEx.indexOf(testValue, secondSelectChoices, isDuplicateChoice) === -1) {
							secondSelectChoices.push(currentSubChoices[j]);
						}
					
					}
				}
				
			}
			
			
			// create and store selects
			this.selects = [];
			this.selects.push(new inputEx.SelectField({ choices: this.options.choices }));
			this.selects.push(new inputEx.SelectField({ choices: secondSelectChoices }));
			
			// append <select>s to DOM tree
			this.fieldContainer.appendChild(this.selects[0].getEl());
			this.fieldContainer.appendChild(this.selects[1].getEl());
			
		}
805814
def clone(self):
        ''' 
        '''
        clone = copy(self)
        clone.variables = {k: v.clone() for (k, v) in self.variables.items()}
        return clone
588769
function cloneArgs(args) {
    var newArgs = {};
    for(var key in args){
      if (key && args.hasOwnProperty(key)) {
        newArgs[key] = args[key];
      }
    }
    newArgs.isCacheableValue = args.isCacheableValue && args.isCacheableValue.bind(newArgs);
    return newArgs;
  }
602838
def clone(self, *args, **overrides):
        
        link = overrides.pop('link', True)
        settings = dict(self.get_param_values(), **overrides)
        if 'id' not in settings:
            settings['id'] = self.id
        if not args and link:
            settings['plot_id'] = self._plot_id

        pos_args = getattr(self, '_' + type(self).__name__ + '__pos_params', [])
        return self.__class__(*(settings[n] for n in pos_args),
                              **{k:v for k,v in settings.items()
                                 if k not in pos_args})
211980
def clone(self):
    """"""
    return type(self)(self.__cmp, self.__key, self.__reverse, name = self.name, dataFormat = self._dataFormat)
1108067
function cloneCounterValues(counters) {
        const result = {};
        Object.keys(counters).forEach(name => {
            result[name] = Array.from(counters[name]);
        });
        return result;
    }
211573
def copy_shell(self):
        
        cls = self.__class__
        new_i = cls()  # create a new group
        new_i.uuid = self.uuid  # with the same id

        # Copy all properties
        for prop in cls.properties:
            if hasattr(self, prop):
                if prop in ['members', 'unknown_members']:
                    setattr(new_i, prop, [])
                else:
                    setattr(new_i, prop, getattr(self, prop))

        return new_i
1254179
def clone_placeholder(self, placeholder):
        
        sp = placeholder.element
        ph_type, orient, sz, idx = (
            sp.ph_type, sp.ph_orient, sp.ph_sz, sp.ph_idx
        )
        id_ = self._next_shape_id
        name = self._next_ph_name(ph_type, id_, orient)
        self._spTree.add_placeholder(id_, name, ph_type, orient, sz, idx)
181810
def preference_was(name, group)
        preference_changed?(name, group) ? preferences_changed_group(group)[name] : preferred(name, group)
      end