Remove an existing fragment component from a URI reference string.
428006
def uridefrag(uristring):
    
    if isinstance(uristring, bytes):
        parts = uristring.partition(b'#')
    else:
        parts = uristring.partition(u'#')
    return DefragResult(parts[0], parts[2] if parts[1] else None)
1251805
public void removeTaggedComponent(final WComponent component) {
		TemplateModel model = getOrCreateComponentModel();
		if (model.taggedComponents != null) {
			// Find tag
			String tag = null;
			for (Map.Entry<String, WComponent> entry : model.taggedComponents.entrySet()) {
				if (entry.getValue().equals(component)) {
					tag = entry.getKey();
					break;
				}
			}
			if (tag != null) {
				removeTaggedComponent(tag);
			}
		}
	}
88440
def delete(method, hmc, uri, uri_parms, logon_required):
        """"""
        try:
            resource = hmc.lookup_by_uri(uri)
        except KeyError:
            raise InvalidResourceError(method, uri)
        resource.manager.remove(resource.oid)
706206
def del_reference(self, source, target, **kwargs):
        
        rc = api.get_tool("reference_catalog")
        uid = api.get_uid(target)
        rc.deleteReference(source, uid, self.relationship)
        # unlink the version of the reference
        self.link_version(source, target)
1132169
private String removeAbsoluteRootPathElement(String xPath) {
        String trimmedXpath = xPath;
        if (xPath.startsWith("/") && xPath.charAt(1) != '/') {
            trimmedXpath = xPath.substring(1);
        }
        return trimmedXpath;
    }
1242074
private void doRemoveComponentMapping() throws PageException {
	admin.removeComponentMapping(getString("admin", action, "virtual"));
	store();
	adminSync.broadcast(attributes, config);
    }
466369
@Deprecated
    public static void markForDeletion(UIComponent component)
    {
        // flag this component as deleted
        component.getAttributes().put(MARK_DELETED, Boolean.TRUE);

        Iterator<UIComponent> iter = component.getFacetsAndChildren();
        while (iter.hasNext())
        {
            UIComponent child = iter.next();
            if (child.getAttributes().containsKey(MARK_CREATED))
            {
                child.getAttributes().put(MARK_DELETED, Boolean.TRUE);
            }
        }
    }
750133
def remove_component(self, name):
        """"""
        if name not in self.components:
            raise Exception("No component named %s" % name)
        del self.components[name]
        del self.depends[name]
        for p in self.provides[name]:
            del self.whoprovides[p]
            self.invalidate(p)
        del self.provides[name]
1025273
def clean_url(url):
    
    parsed = urlparse(url.strip())
    reconstructed = ParseResult(
        parsed.scheme, parsed.netloc, parsed.path,
        params='', query='', fragment='')
    return reconstructed.geturl()
819476
def removeComponent(self, component):
        
        if isinstance(component, int):
            index = component
        else:
            index = self._getComponentIndex(component)
        index = normalizers.normalizeIndex(index)
        if index >= self._len__components():
            raise ValueError("No component located at index %d." % index)
        self._removeComponent(index)
1046678
private function cleanupAnchor(string $uri): string
    {
        if (false !== $pos = strpos($uri, '#')) {
            return substr($uri, 0, $pos);
        }

        return $uri;
    }
292349
def clean_url(url, force_scheme=None):
    """"""
    # URL should be ASCII according to RFC 3986
    url = str(url)
    # Collapse ../../ and related
    url_parts = urlparse.urlparse(url)
    path_parts = []
    for part in url_parts.path.split('/'):
        if part == '.':
            continue
        elif part == '..':
            if path_parts:
                path_parts.pop()
        else:
            path_parts.append(part)

    url_parts = list(url_parts)
    if force_scheme:
        url_parts[0] = force_scheme
    url_parts[2] = '/'.join(path_parts)

    if FLAGS.keep_query_string == False:
        url_parts[4] = ''    # No query string

    url_parts[5] = ''    # No path

    # Always have a trailing slash
    if not url_parts[2]:
        url_parts[2] = '/'

    return urlparse.urlunparse(url_parts)
423917
def extract_fragment(self, iri: str) -> str:
        ''' 
        '''
        fragment = str(iri).rsplit('/')[-1].split(':', 1)[-1].split('#', 1)[-1].split('_', 1)[-1]
        return fragment
816476
public void unregisterComponentBindingsProvider(ServiceReference reference) {
		log.info("unregisterComponentBindingsProvider");
		String[] resourceTypes = OsgiUtil.toStringArray(reference
				.getProperty(ComponentBindingsProvider.RESOURCE_TYPE_PROP),
				new String[0]);
		for (String resourceType : resourceTypes) {
			if (!this.containsKey(resourceType)) {
				continue;
			}
			get(resourceType).remove(reference);
		}
	}
902096
def remove(self):
        """"""
        if self.exists() or self.islink():
            self.fs.unlink(self.get_internal_path())
            return 1
        return None
901818
private boolean removePreferenceFragment() {
        if (!isSplitScreen() && isPreferenceFragmentShown() && !isNavigationHidden() &&
                !isButtonBarShown()) {
            navigationFragment.selectNavigationPreference(-1, null);
            removePreferenceFragmentUnconditionally();
            selectedPreferenceFragment = null;
            selectedPreferenceFragmentArguments = null;
            return true;
        }

        return false;
    }
721468
def urljoin(*fragments):
    """"""
    # Strip possible already existent final slashes of fragments except for the last one
    parts = [fragment.rstrip('/') for fragment in fragments[:len(fragments) - 1]]
    parts.append(fragments[-1])

    return '/'.join(parts)