used to break all known links to this mbox
324695
void breakLinks(final OtpErlangObject reason) {
        final Link[] l = links.clearLinks();

        if (l != null) {
            final int len = l.length;

            for (int i = 0; i < len; i++) {
                exit(1, l[i].remote(), reason);
            }
        }
    }
1374123
protected function parseInlineLinks()
	{
		preg_match_all(
			'/\\[(?:[^\\x17[\\]]|\\[[^\\x17[\\]]*\\])*\\]\\(( *(?:[^\\x17\\s()]|\\([^\\x17\\s()]*\\))*(?=[ )]) *(?:"[^\\x17]*?"|\'[^\\x17]*?\'|\\([^\\x17)]*\\))? *)\\)/',
			$this->text,
			$matches,
			PREG_OFFSET_CAPTURE | PREG_SET_ORDER
		);
		foreach ($matches as $m)
		{
			$linkInfo = $m[1][0];
			$startPos = $m[0][1];
			$endLen   = 3 + strlen($linkInfo);
			$endPos   = $startPos + strlen($m[0][0]) - $endLen;

			$this->addLinkTag($startPos, $endPos, $endLen, $linkInfo);
		}
	}
789014
def _format_links_fields(self, links):
        
        fields = list()
        for link in links:
            linked_model = link['mdl'](super_context)
            null = self._marker_true if link['null'] is True else self._marker_false
            # In LinkProxy, if reverse_name is empty then only reverse has the name
            # of the field on the link_source side
            field_name = link['field'] or link['reverse']
            fields.append((self._field_prefix, field_name, '%s()' % linked_model.title, null))
        fields.sort(key=lambda f: f[1])
        return fields
124039
def enable_all_links():
    """"""
    for link in client.list_data_links(instance='simulator'):
        client.enable_data_link(instance=link.instance, link=link.name)
585726
def findLinksRel(link_attrs_list, target_rel):
    """"""
    # XXX: TESTME
    matchesTarget = lambda attrs: linkHasRel(attrs, target_rel)
    return list(filter(matchesTarget, link_attrs_list))
570499
synchronized Link[] clearLinks() {
        Link[] ret = null;
        if (count != 0) {
            ret = new Link[count];
            for (int i = 0; i < count; i++) {
                ret[i] = links[i];
                links[i] = null;
            }
            count = 0;
        }
        return ret;
    }
381064
def link(self):
        
        if self.source in self.registry:
            links = self.registry[self.source]
            params = {
                k: v for k, v in self.get_param_values() if k != 'name'}
            for link in links:
                link_params = {
                    k: v for k, v in link.get_param_values() if k != 'name'}
                if (type(link) is type(self) and link.source is self.source
                    and link.target is self.target and params == link_params):
                    return
            self.registry[self.source].append(self)
        else:
            self.registry[self.source] = [self]
256031
def all_origins(m):
    '''
    
    '''
    seen = set()
    for link in m.match():
        origin = link[ORIGIN]
        if origin not in seen:
            seen.add(origin)
            yield origin
703364
def links(self):
        """"""
        ret = []
        linkheader = self.getheader('link')
        if not linkheader:
            return ret
        for i in linkheader.split(','):
            try:
                url, params = i.split(';', 1)
            except ValueError:
                url, params = i, ''
            link = {}
            link['url'] = url.strip('''<> '"''')
            for param in params.split(';'):
                try:
                    k, v = param.split('=')
                except ValueError:
                    break
                link[k.strip(''' '"''')] = v.strip(''' '"''')
            ret.append(link)
        return ret
302593
function toAbsoluteLinks(data, originUrl) {

        var host = getHost(stripTrailingSlash(originUrl));

        function prefixLinks(links) {
            if (host) {
                angular.forEach(links, function (linkValue, linkKey) {
                    if (linkValue.href.charAt(0) === '/') {
                        linkValue.href = host + linkValue.href;
                        links[linkKey] = linkValue;
                    }
                });
            }
        }

        function walkTree(node, action) {

            action(node[config.linksKey]);

            angular.forEach(node[config.embeddedKey], function (embedded) {
                if (embedded instanceof Array) {
                    angular.forEach(embedded, function (embeddedItem) {
                        walkTree(embeddedItem, action);
                    });

                } else {
                    walkTree(embedded, action);

                }
            });
        }

        walkTree(data, prefixLinks);

    }
1250025
def _remove_broken_links():
    '''
    
    '''
    enabled_dir = MICRODROP_CONDA_PLUGINS.joinpath('enabled')
    if not enabled_dir.isdir():
        return []

    broken_links = []
    for dir_i in enabled_dir.walkdirs(errors='ignore'):
        if platform.system() == 'Windows':
            if dir_i.isjunction() and not dir_i.readlink().isdir():
                # Junction/link target no longer exists.
                broken_links.append(dir_i)
        else:
            raise NotImplementedError('Unsupported platform')

    removed_links = []
    for link_i in broken_links:
        try:
            link_i.unlink()
        except:
            pass
        else:
            removed_links.append(link_i)
    return removed_links
160263
def unlink(self, parameter):
        

        if not isinstance(parameter,list):
        # Make a list of one element
            parameter_list  = [parameter]
        else:
        # Make a copy to avoid tampering with the input
            parameter_list = list(parameter)
            
        for param in parameter_list:    
            if param.has_auxiliary_variable():
                param.remove_auxiliary_variable()

            else:

                with warnings.catch_warnings():

                    warnings.simplefilter("always", RuntimeWarning)

                    warnings.warn("Parameter %s has no link to be removed." % param.path, RuntimeWarning)
143114
def remove_link(self, obj, attr=None):
        
        name = repr(self)
        if not name:
            return self
        l = self.__class__._get_links()
        v = WeakAttrLink(None, obj) if attr is None else WeakAttrLink(obj, attr)
        if name in l:
            if v in l[name]:
                l[name].remove(v)
            if not l[name]:
                l.pop(name)
        return self
63240
def parse_link_header(link):
    
    rel_dict = {}
    for rels in link.split(','):
        rel_break = quoted_split(rels, ';')
        try:
            rel_url = re.search('<(.+?)>', rel_break[0]).group(1)
            rel_names = quoted_split(rel_break[1], '=')[-1]
            if rel_names.startswith('"') and rel_names.endswith('"'):
                    rel_names = rel_names[1:-1]
            for name in rel_names.split():
                rel_dict[name] = rel_url
        except (AttributeError, IndexError):
            pass

    return rel_dict
11600
def unlink(self, *others):
        
        if not len(others):
            others = self.links[:]
        for p in self.links[:]:
            if p in others:
                p.teardown()
        return self
1110312
function splitAndFlattenLinkParams(linkParams) {
    var accumulation = [];
    linkParams.forEach(function (item) {
        if (isString(item)) {
            var strItem = item;
            accumulation = accumulation.concat(strItem.split('/'));
        }
        else {
            accumulation.push(item);
        }
    });
    return accumulation;
}
127774
def all_as_href(self):
        
        if not self.is_any and not self.is_none:
            return [element for element in self.get(self.typeof)]
        return []