Consolidates this soft copy prior to modification. This will detach this
instance from its parent, creating a true copy of its current data.
424951
public synchronized void consolidateSoftCopy() throws IOException {
		if (isSoftCopy == true) {
			ArrayList<NikeFS2Block> copyBlocks = new ArrayList<NikeFS2Block>();
			if (blocks.size() > 0) {
				// make copies of all contained blocks
				byte[] buffer = new byte[blocks.get(0).size()];
				for (NikeFS2Block block : blocks) {
					NikeFS2Block copyBlock = vfs.allocateBlock();
					block.read(0, buffer);
					copyBlock.write(0, buffer);
					copyBlocks.add(copyBlock);
				}
			}
			// replace blocks list
			blocks = copyBlocks;
			isSoftCopy = false;
			// deregister from template
			parent.deregisterSoftCopy(this);
			parent = null;
		}
	}
521663
public void release() {
	parent = null;
	id = null;
	if( values != null ) {
	    values.clear();
	}
	values = null;
    }
636366
protected function revokeConsolidatedMethods()
        {
            $class = $this->class;

            foreach (self::$prototypes as $prototype) {
                if (!is_subclass_of($prototype->class, $class)) {
                    continue;
                }

                $prototype->consolidatedMethods = null;
            }

            $this->consolidatedMethods = null;
        }
1125038
protected function storeData()
    {
        if ($this->currentCellIsDirty && !empty($this->currentObjectID)) {
            $this->currentObject->detach();

            $this->cellCache[$this->currentObjectID] = gzdeflate(serialize($this->currentObject));
            $this->currentCellIsDirty = false;
        }
        $this->currentObjectID = $this->currentObject = null;
    }
76119
@Override
	public synchronized void close() throws IOException {
		alertSoftCopies();
		if (parent != null) {
			parent.deregisterSoftCopy(this);
		}
		if (isSoftCopy == false) {
			// frees our rightfully owned blocks
			super.close();
		} else {
			// shared blocks must not be freed (soft copy)
			blocks = null;
			size = 0;
			pointer = 0;
		}
	}
247247
public DeferredValue<V> shallowCopy() {
        if (this == NULL_VALUE) {
            return NULL_VALUE;
        }
        DeferredValue<V> copy = new DeferredValue<V>();
        if (serializedValueExists) {
            copy.serializedValueExists = true;
            copy.serializedValue = serializedValue;
        }
        if (valueExists) {
            copy.valueExists = true;
            copy.value = value;
        }
        return copy;
    }
1036639
public void consolidate(List targets) 
  {
    if (tc.isEntryEnabled()) SibTr.entry(tc, "consolidate", targets);
     Iterator itr = targets.iterator();
     
     // Reset the lists for this level
     levelUsersAllowedToSubscribe.clear();
     levelUsersAllowedToPublish.clear();
     levelGroupAllowedToSubscribe.clear();
     levelGroupAllowedToPublish.clear();
     
     while (itr.hasNext())
     {
       Object target = itr.next();
       if (target instanceof TopicAcl)
       {
         // Extract the principal
         Principal principal = ((TopicAcl)target).getPrincipal();
         // Check the operation type
         if(((TopicAcl)target).getOperationType() == 1)  
         { 
           if(principal == null)
           {
             // This is an inheritance blocker
             accumUsersAllowedToPublish.clear();
             accumGroupAllowedToPublish.clear();
           }
           else if(principal instanceof Group)
           {
             levelGroupAllowedToPublish.add(principal);
           }
           else
           {
             levelUsersAllowedToPublish.add(principal);                     
           }
         }
         else
         { 
           if(principal == null)
           {
               // This is an inheritance blocker
               accumUsersAllowedToSubscribe.clear();
               accumGroupAllowedToSubscribe.clear();
           }
           else if(principal instanceof Group)
           {
             levelGroupAllowedToSubscribe.add(principal);
           }
           else
           {
             levelUsersAllowedToSubscribe.add(principal);                     
           }
         }
       }
     }
     
     if(!levelUsersAllowedToSubscribe.isEmpty())
     {
       accumUsersAllowedToSubscribe.addAll(levelUsersAllowedToSubscribe);
     }
     if(!levelUsersAllowedToPublish.isEmpty())
     {
       accumUsersAllowedToPublish.addAll(levelUsersAllowedToPublish);
     }    
     if(!levelGroupAllowedToSubscribe.isEmpty())
     {
       accumGroupAllowedToSubscribe.addAll(levelGroupAllowedToSubscribe);
     }    
     if(!levelGroupAllowedToPublish.isEmpty())
     {
       accumGroupAllowedToPublish.addAll(levelGroupAllowedToPublish);
     } 
     
     if (tc.isEntryEnabled()) SibTr.exit(tc, "consolidate");        
  }
1184840
public function detach()
    {
        $data = $this->result->getData($this->id);
        $this->result = Result::createDetachedInstance();
        foreach ($data as $key => $value) {
            $this->result->setDataEntry(Result::DETACHED_ROW_ID, $key, $value);
        }
        $this->id = Result::DETACHED_ROW_ID;
    }
1363251
public function clear()
    {
        $this->id = null;
        $this->locale = null;
        $this->description = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->applyDefaultValues();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
557122
def _consolidate_repo_sources(sources):
    '''
    
    '''
    if not isinstance(sources, sourceslist.SourcesList):
        raise TypeError(
            '\'{0}\' not a \'{1}\''.format(
                type(sources),
                sourceslist.SourcesList
            )
        )

    consolidated = {}
    delete_files = set()
    base_file = sourceslist.SourceEntry('').file

    repos = [s for s in sources.list if not s.invalid]

    for repo in repos:
        repo.uri = repo.uri.rstrip('/')
        # future lint: disable=blacklisted-function
        key = str((getattr(repo, 'architectures', []),
                   repo.disabled, repo.type, repo.uri, repo.dist))
        # future lint: enable=blacklisted-function
        if key in consolidated:
            combined = consolidated[key]
            combined_comps = set(repo.comps).union(set(combined.comps))
            consolidated[key].comps = list(combined_comps)
        else:
            consolidated[key] = sourceslist.SourceEntry(salt.utils.pkg.deb.strip_uri(repo.line))

        if repo.file != base_file:
            delete_files.add(repo.file)

    sources.list = list(consolidated.values())
    sources.save()
    for file_ in delete_files:
        try:
            os.remove(file_)
        except OSError:
            pass
    return sources
864161
void discardUnusedTail()
    {
        // we guard this with the OpOrdering instead of synchronised due to potential dead-lock with CLSM.advanceAllocatingFrom()
        // this actually isn't strictly necessary, as currently all calls to discardUnusedTail occur within a block
        // already protected by this OpOrdering, but to prevent future potential mistakes, we duplicate the protection here
        // so that the contract between discardUnusedTail() and sync() is more explicit.
        try (OpOrder.Group group = appendOrder.start())
        {
            while (true)
            {
                int prev = allocatePosition.get();
                // we set allocatePosition past buffer.capacity() to make sure we always set discardedTailFrom
                int next = buffer.capacity() + 1;
                if (prev == next)
                    return;
                if (allocatePosition.compareAndSet(prev, next))
                {
                    discardedTailFrom = prev;
                    return;
                }
            }
        }
    }
281251
public void free()
    {
        if (m_record != null) // First, release the record for this table
        { // Do not free this.getFieldList() (may be current record)
            m_record.setTable(null);    // Don't try to free me
            m_record.free();
            m_record = null;
        }
    }
230382
function () {
    var hasComponentChanged;

    // Store the previous old data before we calculate the new oldData.
    if (this.previousOldData instanceof Object) {
      utils.objectPool.clearObject(this.previousOldData);
    }
    if (this.isObjectBased) {
      copyData(this.previousOldData, this.oldData);
    } else {
      this.previousOldData = this.oldData;
    }

    hasComponentChanged = !utils.deepEqual(this.oldData, this.data);

    // Don't update if properties haven't changed.
    // Always update rotation, position, scale.
    if (!this.isPositionRotationScale && !hasComponentChanged) { return; }

    // Store current data as previous data for future updates.
    // Reuse `this.oldData` object to try not to allocate another one.
    if (this.oldData instanceof Object) { utils.objectPool.clearObject(this.oldData); }
    this.oldData = extendProperties(this.oldData, this.data, this.isObjectBased);

    // Update component with the previous old data.
    this.update(this.previousOldData);

    this.throttledEmitComponentChanged();
  }
1191964
def MergeData(self, merge_data, raw_data=None):
    """"""
    self.FlushCache()
    if raw_data is None:
      raw_data = self.raw_data

    for k, v in iteritems(merge_data):
      # A context clause.
      if isinstance(v, dict) and k not in self.type_infos:
        if k not in self.valid_contexts:
          raise InvalidContextError("Invalid context specified: %s" % k)
        context_data = raw_data.setdefault(k, collections.OrderedDict())
        self.MergeData(v, context_data)

      else:
        # Find the descriptor for this field.
        descriptor = self.type_infos.get(k)
        if descriptor is None:
          msg = ("Missing config definition for %s. This option is likely "
                 "deprecated or renamed. Check the release notes." % k)
          if flags.FLAGS.disallow_missing_config_definitions:
            raise MissingConfigDefinitionError(msg)

        if isinstance(v, string_types):
          v = v.strip()

        # If we are already initialized and someone tries to modify a constant
        # value (e.g. via Set()), break loudly.
        if self.initialized and k in self.constants:
          raise ConstModificationError(
              "Attempting to modify constant value %s" % k)

        raw_data[k] = v
499988
def detach(self):
		

		# First, wipe default source on all customers that use this.
		Customer.objects.filter(default_source=self.id).update(default_source=None)

		try:
			# TODO - we could use the return value of sync_from_stripe_data
			#  or call its internals - self._sync/_attach_objects_hook etc here
			#  to update `self` at this point?
			self.sync_from_stripe_data(self.api_retrieve().detach())
			return True
		except (InvalidRequestError, NotImplementedError):
			# The source was already detached. Resyncing.
			# NotImplementedError is an artifact of stripe-python<2.0
			# https://github.com/stripe/stripe-python/issues/376
			self.sync_from_stripe_data(self.api_retrieve())
			return False
537652
public void free()
    {
        int iOldEditMode = 0;
        if (m_record != null) // First, release the record for this table
        {
            iOldEditMode = this.getRecord().getEditMode();
            this.getRecord().setEditMode(iOldEditMode | DBConstants.EDIT_CLOSE_IN_FREE);    // This is a cludge... signals tables that this is the last close()!
        }
        this.close();
        if (m_record != null) // First, release the record for this table
            this.getRecord().setEditMode(iOldEditMode);   // This is a cludge... signals tables that this is the last close()!

        super.free(); // Set the record's table reference to null.

        if (m_database != null)
            m_database.removeTable(this);
        m_database = null;
        m_dataSource = null;
        m_objectID = null;
    }
1269802
def copy(self, strip=None, deep='ref'):
        
        dd = self.to_dict(strip=strip, deep=deep)
        return self.__class__(fromdict=dd)