Creates an instance based on the current state of this one.

@return a deep copy.
776227
public Datastream copy() {
        Datastream copy = new Datastream(id)
                .state(state)
                .controlGroup(controlGroup)
                .versionable(versionable);
        for (DatastreamVersion version: versions) {
            copy.versions().add(version.copy());
        }
        return copy;
    }
1079415
public FeatureState copy() {
        FeatureState copy = new FeatureState(feature);
        copy.setEnabled(this.enabled);
        copy.setStrategyId(this.strategyId);
        for (Entry<String, String> entry : this.parameters.entrySet()) {
            copy.setParameter(entry.getKey(), entry.getValue());
        }
        return copy;
    }
1276808
public Record copy() {
    //return new Record(ArrayListMultimap.create(fields)); // adding fields later causes (slow) rehashing
    ArrayListMultimap<String,Object> copy = ArrayListMultimap.create(fields.size() + 16, 10);
    copy.putAll(fields);
    return new Record(copy);
  }
163022
function(deep) {
      var newObj = {},
          i;

      if (obj === null || !wysihtml5.lang.object(obj).isPlainObject()) {
        return obj;
      }

      for (i in obj) {
        if(obj.hasOwnProperty(i)) {
          if (deep) {
            newObj[i] = wysihtml5.lang.object(obj[i]).clone(deep);
          } else {
            newObj[i] = obj[i];
          }
        }
      }
      return newObj;
    }
513399
protected Proxy copy(){
       Socks4Proxy copy = new Socks4Proxy(proxyIP,proxyPort,user);
       copy.directHosts = this.directHosts;
       copy.chainProxy = chainProxy;
       return copy;
    }
199869
public DSLSentence copy() {
        final DSLSentence copy = new DSLSentence();

        copy.drl = getDrl();
        copy.definition = getDefinition();
        copy.values = mapCopy(getValues());

        return copy;
    }
113332
def copy
    copy = super
    #Make deep copy of each behavior.
    copy.instance_eval {@behaviors = []}
    self.behaviors.each {|behavior| copy.add_behavior(behavior.copy)}
    copy
  end
312496
function clone() {
    var cloned = new this.constructor(this.client);
    cloned._method = this._method;
    cloned._single = assign({}, this._single);
    cloned._options = assign({}, this._options);
    cloned._statements = this._statements.slice();
    return cloned;
  }
910184
public ExampleSet copy()
	{
		ExampleSet copy = new SentenceSetCopy();
		for (int i=0;i<size();i++)
			copy.add(x(i), y(i), id(i));

		return copy;
	}
1039598
def copy(self):
        
        from copy import deepcopy
        cp = type(self)()
        cp._metainfo = deepcopy(self._metainfo)
        return cp
829093
public SimpleDependencyPath copy() {
        SimpleDependencyPath copy = new SimpleDependencyPath();
        copy.path.addAll(path);
        copy.nodes.addAll(nodes);
        return copy;
    }
639910
def copy(self, empty=False):
        """"""
        
        # Create an empty object
        newobject = self.__new__(self.__class__)
        if empty:
            return
        
        # And fill it !
        for prop in ["_properties","_side_properties",
                     "_derived_properties","_build_properties"
                     ]:
            if prop not in dir(self):
                continue
            try: # Try to deep copy because but some time it does not work (e.g. wcs) 
                newobject.__dict__[prop] = copy.deepcopy(self.__dict__[prop])
            except:
                newobject.__dict__[prop] = copy.copy(self.__dict__[prop])
                
        # This be sure things are correct
        newobject._update_()
        # and return it
        return newobject
1265113
public LofPoint deepCopy()
    {
        LofPoint result = new LofPoint();
        result.setDataId(this.dataId);
        result.setkDistance(this.kDistance);

        double[] copiedArray = Arrays.copyOf(this.dataPoint, this.dataPoint.length);
        result.setDataPoint(copiedArray);

        List<String> copiedList = new ArrayList<>();
        if (this.kDistanceNeighbor != null)
        {
            copiedList.addAll(this.kDistanceNeighbor);
        }

        result.setkDistanceNeighbor(copiedList);
        result.setLrd(this.lrd);
        return result;
    }
409052
public FedoraObject copy() {
        FedoraObject copy = new FedoraObject()
                .pid(pid)
                .state(state)
                .label(label)
                .ownerId(ownerId)
                .createdDate(Util.copy(createdDate))
                .lastModifiedDate(Util.copy(lastModifiedDate));
        for (Datastream ds: datastreams.values()) {
            copy.putDatastream(ds.copy());
        }
        return copy;
    }
1327528
public static RecurrenceUtil getInstance() {

    if (instance == null) {
      synchronized (RecurrenceUtilImpl.class) {
        if (instance == null) {
          RecurrenceUtilImpl impl = new RecurrenceUtilImpl();
          impl.initialize();
          instance = impl;
        }
      }
    }
    return instance;
  }
1297498
def copy(self):
        """"""
        attrs = {k: self.__dict__[k].copy() for k in self.containers}
        attrs.update({k: cp.deepcopy(self.__dict__[k]) for k in self.shared})
        return self.__class__(**attrs)
19621
public function create()
    {
        $instance = self::createState($this);
        $this->setId($instance->getId());
        return $instance;
    }