Removes redundant acquaintance opportunities.
344333
def remove_redundant_acquaintance_opportunities(
        strategy: circuits.Circuit) -> int:
    """"""
    if not is_acquaintance_strategy(strategy):
        raise TypeError('not is_acquaintance_strategy(circuit)')

    qubits = sorted(strategy.all_qubits())
    mapping = {q: i for i, q in enumerate(qubits)}

    expose_acquaintance_gates(strategy)
    annotated_strategy = strategy.copy()
    LogicalAnnotator(mapping)(annotated_strategy)

    new_moments = [] # type: List[ops.Moment]
    acquaintance_opps = set() # type: Set[FrozenSet[int]]
    n_removed = 0
    for moment in annotated_strategy:
        new_moment = [] # type: List[ops.Operation]
        for op in moment:
            if isinstance(op, AcquaintanceOperation):
                opp = frozenset(cast(Sequence[int], op.logical_indices))
                if opp not in acquaintance_opps:
                    acquaintance_opps.add(opp)
                    new_moment.append(acquaint(*op.qubits))
                else:
                    n_removed += 1
            else:
                new_moment.append(op)
        new_moments.append(ops.Moment(new_moment))
    strategy._moments = new_moments
    return n_removed
78555
protected void removeDuplicates ()
    {
        if (_size > 1) {
            int last = _values[0];
            for (int ii = 1; ii < _size; ) {
                if (_values[ii] == last) { // shift everything down 1
                    _size--;
                    System.arraycopy(_values, ii + 1, _values, ii, _size - ii);
                } else {
                    last = _values[ii++];
                }
            }
        }
    }
469705
def cleanup_pbar(self):
        """"""
        if hasattr(self, 'pbar') and self.pbar:
            self.pbar.close()
            self.pbar = None
885344
def remove_by(keys, original):
    """"""
    for i in [
            original[index]
            for index, needed in enumerate(keys) if not needed
    ]:
        original.remove(i)
874358
public synchronized void clearDisappearedJob() {
        getCron4jJobList().stream().filter(job -> job.isDisappeared()).forEach(job -> {
            final LaJobKey jobKey = job.getJobKey();
            jobKeyJobMap.remove(jobKey);
            jobOrderedList.remove(job);
            job.getJobUnique().ifPresent(jobUnique -> jobUniqueJobMap.remove(jobUnique));
            cron4jTaskJobMap.remove(job.getCron4jTask());
        });
    }
725989
function removeUnreferencedIDs() {
  var identifiedElements = $('[id]');
  var referencedIDs = findReferencedElements();
  _(identifiedElements).each(function(node) {
      var $node = $(node);
      var id = $node.attr('id');
      if(!_(referencedIDs).has(id)) {
        $node.removeAttr('id');
      };
  });
}
1008326
def delete_all_friendships
      friend_ids.clear
      inverse_friend_ids.clear
      pending_friend_ids.clear
      pending_inverse_friend_ids.clear
      blocked_friend_ids.clear
      blocked_inverse_friend_ids.clear
      blocked_pending_friend_ids.clear
      blocked_pending_inverse_friend_ids.clear
      self.save
    end
611534
@Override
    public synchronized void removeAssociation() {
        final boolean traceOn = TraceComponent.isAnyTracingEnabled();

        if (traceOn && tc.isEntryEnabled())
            Tr.entry(tc, "removeAssociation");

        _activeAssociations--;

        if (_activeAssociations <= 0) {
            startInactivityTimer();
        } else {
            _mostRecentThread.pop();
        }

        notifyAll(); //LIDB1673.23

        if (traceOn && tc.isEntryEnabled())
            Tr.exit(tc, "removeAssociation");
    }
1009512
protected void removeExistingEntity(String localId) {
		if (StringUtils.isEmpty(localId))
			return;
		List<Feature> listOfFeature = featureRepo.getFeatureIdById(localId);

		if (CollectionUtils.isEmpty(listOfFeature))
			return;
		featureRepo.delete(listOfFeature);
	}
381129
public function remove() : void
    {
        if ($this->onlineIdParameter() === 'me') return;

        $this->delete(sprintf(self::USERS_ENDPOINT . 'friendList/%s', $this->client->onlineId(), $this->onlineId()));
    }
405765
private void removeAccoundDependencies(Sid sid) {
        logger.debug("removing accoutn dependencies");
        DaoManager daoManager = (DaoManager) context.getAttribute(DaoManager.class.getName());
        // remove dependency entities first and dependent entities last. Also, do safer operation first (as a secondary rule)
        daoManager.getAnnouncementsDao().removeAnnouncements(sid);
        daoManager.getNotificationsDao().removeNotifications(sid);
        daoManager.getShortCodesDao().removeShortCodes(sid);
        daoManager.getOutgoingCallerIdsDao().removeOutgoingCallerIds(sid);
        daoManager.getTranscriptionsDao().removeTranscriptions(sid);
        daoManager.getRecordingsDao().removeRecordings(sid);
        daoManager.getApplicationsDao().removeApplications(sid);
        removeIncomingPhoneNumbers(sid,daoManager.getIncomingPhoneNumbersDao());
        daoManager.getClientsDao().removeClients(sid);
        profileAssociationsDao.deleteProfileAssociationByTargetSid(sid.toString());
    }
91358
public void cleanUp() {
    m_Owner     = null;
    m_Train     = null;
    m_Test      = null;
    m_Generator = null;
    m_Values    = null;
  }
559936
def cleanup(self):
        
        remove = []
        for handle, assoc in self.assocs.items():
            if assoc.expiresIn == 0:
                remove.append(handle)
        for handle in remove:
            del self.assocs[handle]
        return len(remove), len(self.assocs)
1197511
public void removeLRU() {
        int removeCount = (int) Math.max((size() * trimFactor), 1);

        while ((removeCount--) > 0) {
            removeEntry(head.next);
        }
    }
1318755
@Deprecated
    public void deleteIssueRelations(Issue redmineIssue) throws RedmineException {
        for (IssueRelation relation : redmineIssue.getRelations()) {
            deleteRelation(relation.getId());
        }
    }
573536
public function clearRedundant()
    {
        Promocode::all()->each(function (Promocode $promocode) {
            if ($promocode->isExpired() || ($promocode->isDisposable() && $promocode->users()->exists())) {
                $promocode->users()->detach();
                $promocode->delete();
            }
        });
    }
955118
protected function removeUnknownReferences()
	{
		foreach ($this->references as &$references)
		{
			$references = array_intersect_key($references, $this->captures);
		}
	}