Unlink the current version of the target from the source
510348
def unlink_version(self, source, target):
        
        if not hasattr(source, REFERENCE_VERSIONS):
            return
        target_uid = api.get_uid(target)
        if target_uid in source.reference_versions[target_uid]:
            # delete the version
            del source.reference_versions[target_uid]
            # persist changes that occured referenced versions
            source._p_changed = 1
        else:
            logger.warn("No version link found on '{}' -> '{}'"
                        .format(repr(source), repr(target)))
208508
public boolean unlink(Object source, String attributeName, Object target)
    {
        return linkOrUnlink(false, source, attributeName, false);
    }
322510
def remove(self):
        
        session = client.get_client().create_session()

        if not self._base_query(session).count() > 0:
            session.close()
            raise RuntimeError("Target does not exist, name={:s}, params={:s}"
                               "".format(self.name, self.params))

        # remove the target from the database
        self._base_query(session).delete()
        session.commit()

        session.close()
1304867
private void unbind(IActionTarget target) {
        if (targets.remove(target) && targets.isEmpty()) {
            getEventManager().unsubscribe(eventName, this);
        }
    }
1293331
def _uninstall(cls):
        
        if cls._hook:
            sys.meta_path.remove(cls._hook)
            cls._hook = None
242545
def delete_relation(self, src, relation, target):
        '''  '''
        self.__require_string__(relation)
        if src in self and target in self:
            self._get_item_node(src).unlink(relation, self._get_item_node(target))
1276883
public void unlink(Object source, CollectionDescriptor cds, Object referenceToUnlink)
    {
        if(cds.isMtoNRelation())
        {
            m_broker.deleteMtoNImplementor(new MtoNImplementor(cds, source, referenceToUnlink));
        }
        else
        {
            ClassDescriptor cld = m_broker.getClassDescriptor(referenceToUnlink.getClass());
            m_broker.unlinkFK(referenceToUnlink, cld, cds);
        }
    }
150557
def copyFuncVersionedLib(dest, source, env):
    """"""

    if os.path.isdir(source):
        raise SCons.Errors.UserError("cannot install directory `%s' as a version library" % str(source) )
    else:
        # remove the link if it is already there
        try:
            os.remove(dest)
        except:
            pass
        shutil.copy2(source, dest)
        st = os.stat(source)
        os.chmod(dest, stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE)
        installShlibLinks(dest, source, env)

    return 0
521692
def cleanup(arctic_lib, symbol, version_ids, versions_coll, shas_to_delete=None, pointers_cfgs=None):
    
    pointers_cfgs = set(pointers_cfgs) if pointers_cfgs else set()
    collection = arctic_lib.get_top_level_collection()
    version_ids = list(version_ids)

    # Iterate versions to check if they are created only with fw pointers, parent pointers (old), or mixed
    # Keep in mind that the version is not yet inserted.
    all_symbol_pointers_cfgs = _get_symbol_pointer_cfgs(symbol, versions_coll)
    all_symbol_pointers_cfgs.update(pointers_cfgs)

    # All the versions of the symbol have been created with old arctic or with disabled forward pointers.
    # Preserves backwards compatibility and regression for old pointers implementation.
    if all_symbol_pointers_cfgs == {FwPointersCfg.DISABLED} or not all_symbol_pointers_cfgs:
        _cleanup_parent_pointers(collection, symbol, version_ids)
        return

    # All the versions of the symbol we wish to delete have been created with forward pointers
    if FwPointersCfg.DISABLED not in all_symbol_pointers_cfgs:
        _cleanup_fw_pointers(collection, symbol, version_ids, versions_coll,
                             shas_to_delete=shas_to_delete, do_clean=True)
        return

    # Reaching here means the symbol has versions with mixed forward pointers and legacy/parent pointer configurations
    _cleanup_mixed(symbol, collection, version_ids, versions_coll)
81503
def remove(ctx, client, sources):
    """"""
    from renku.api._git import _expand_directories

    def fmt_path(path):
        """Format path as relative to the client path."""
        return str(Path(path).absolute().relative_to(client.path))

    files = {
        fmt_path(source): fmt_path(file_or_dir)
        for file_or_dir in sources
        for source in _expand_directories((file_or_dir, ))
    }

    # 1. Update dataset metadata files.
    with progressbar(
        client.datasets.values(),
        item_show_func=lambda item: str(item.short_id) if item else '',
        label='Updating dataset metadata',
        width=0,
    ) as bar:
        for dataset in bar:
            remove = []
            for key, file_ in dataset.files.items():
                filepath = fmt_path(file_.full_path)
                if filepath in files:
                    remove.append(key)

            if remove:
                for key in remove:
                    dataset.unlink_file(key)

                dataset.to_yaml()

    # 2. Manage .gitattributes for external storage.
    tracked = tuple(
        path for path, attr in client.find_attr(*files).items()
        if attr.get('filter') == 'lfs'
    )
    client.untrack_paths_from_storage(*tracked)
    existing = client.find_attr(*tracked)
    if existing:
        click.echo(WARNING + 'There are custom .gitattributes.\n')
        if click.confirm(
            'Do you want to edit ".gitattributes" now?', default=False
        ):
            click.edit(filename=str(client.path / '.gitattributes'))

    # Finally remove the files.
    final_sources = list(set(files.values()))
    if final_sources:
        run(['git', 'rm', '-rf'] + final_sources, check=True)
160437
public static void unlink(final ODatabaseGraphTx iDatabase, final ODocument iSourceVertex, final ODocument iTargetVertex) {
		if (iTargetVertex == null)
			throw new IllegalArgumentException("Missed the target vertex");

		if (iDatabase.existsUserObjectByRID(iSourceVertex.getIdentity())) {
			// WORK ALSO WITH IN MEMORY OBJECTS

			final OGraphVertex vertex = (OGraphVertex) iDatabase.getUserObjectByRecord(iSourceVertex, null);
			// REMOVE THE EDGE OBJECT
			if (vertex.out != null) {
				final Set<OGraphEdge> obj = vertex.out.get();
				if (obj != null)
					for (OGraphEdge e : obj)
						if (e.getIn().getDocument().equals(iTargetVertex))
							obj.remove(e);
			}
		}

		if (iDatabase.existsUserObjectByRID(iTargetVertex.getIdentity())) {
			// WORK ALSO WITH IN MEMORY OBJECTS

			final OGraphVertex vertex = (OGraphVertex) iDatabase.getUserObjectByRecord(iTargetVertex, null);
			// REMOVE THE EDGE OBJECT FROM THE TARGET VERTEX
			if (vertex.in != null) {
				final Set<OGraphEdge> obj = vertex.in.get();
				if (obj != null)
					for (OGraphEdge e : obj)
						if (e.getOut().getDocument().equals(iSourceVertex))
							obj.remove(e);
			}
		}

		final List<ODocument> edges2Remove = new ArrayList<ODocument>();

		// REMOVE THE EDGE DOCUMENT
		ODocument edge = null;
		Set<ODocument> docs = iSourceVertex.field(OGraphDatabase.VERTEX_FIELD_OUT);
		if (docs != null) {
			// USE A TEMP ARRAY TO AVOID CONCURRENT MODIFICATION TO THE ITERATOR
			for (OIdentifiable d : docs) {
				final ODocument doc = (ODocument) d.getRecord();
				if (doc.field(OGraphDatabase.EDGE_FIELD_IN).equals(iTargetVertex)) {
					edges2Remove.add(doc);
					edge = doc;
				}
			}

			for (ODocument d : edges2Remove)
				docs.remove(d);
		}

		if (edge == null)
			throw new OGraphException("Edge not found between the ougoing edges");

		iSourceVertex.setDirty();
		iSourceVertex.save();

		docs = iTargetVertex.field(OGraphDatabase.VERTEX_FIELD_IN);

		// REMOVE THE EDGE DOCUMENT FROM THE TARGET VERTEX
		if (docs != null) {
			edges2Remove.clear();

			for (OIdentifiable d : docs) {
				final ODocument doc = (ODocument) d.getRecord();
				if (doc.field(OGraphDatabase.EDGE_FIELD_IN).equals(iTargetVertex))
					edges2Remove.add(doc);
			}

			for (ODocument d : edges2Remove)
				docs.remove(d);
		}

		iTargetVertex.setDirty();
		iTargetVertex.save();

		edge.delete();
	}
856748
def unlink(self, func):
        '''
        

        '''
        if func in self._syn_links:
            self._syn_links.remove(func)
1294673
def remove_target(self, target_id):
        """"""
        updated_targets = []
        for target in self.my_osid_object_form._my_map['targets']:
            if target['id'] != target_id:
                updated_targets.append(target)
        self.my_osid_object_form._my_map['targets'] = updated_targets
469078
def revert_to(self):

		'''
		
		'''

		# send patch
		response = self.resource.repo.api.http_request('PATCH', self.uri)

		# if response 204
		if response.status_code == 204:
			logger.debug('reverting to previous version of resource, %s' % self.uri)

			# refresh current resource handle
			self._current_resource.refresh()

		else:
			raise Exception('HTTP %s, could not revert to resource version, %s' % (response.status_code, self.uri))
927752
def symlink(target, link):
    
    if islink(link):
        unlink(link)
    if platform.system() == "Windows":
        if sys.version_info[:2] < (3, 5):
            with open(os.devnull, "w") as nul:
                subprocess.check_call(["mklink", "/J", link, target], shell=True, stdout=nul)
        else:
            _winapi.CreateJunction(target, link)
    else:
        os.symlink(target, link)
203096
function unlink(path, callback) {
        appshell.fs.unlink(path, function (err) {
            callback(_mapError(err));
        });
    }
21176
function unlinkIfLinked() {
  const sharedDeps = getSharedLinked(packageKeys, packageHash);
  if (sharedDeps.length) {
    unlinkPackage(sharedDeps);
  } else {
    log('No shared linked dependencies found');
  }
}