Iterate links of a JavaScript pseudo-link attribute.
436079
def iter_links_by_js_attrib(self, attrib_name, attrib_value):
        ''''''
        links = self.javascript_scraper.scrape_links(attrib_value)

        for link in links:
            yield attrib_name, link
1020143
def rel_links(cls, page):
    """"""
    for match in cls.REL_RE.finditer(page):
      href, rel = match.group(0), match.group(1)
      if rel not in cls.REL_TYPES:
        continue
      href_match = cls.HREF_RE.search(href)
      if href_match:
        href = cls.href_match_to_url(href_match)
        parsed_href = urlparse(href)
        if any(parsed_href.path.endswith(ext) for ext in cls.REL_SKIP_EXTENSIONS):
          continue
        yield href
1223161
function at_link() {
  match(/\{@link/)
  skip_horiz_white();

  var linkText = strip(match(/.*?\}/)).replace(/\s*@link\s*/, "").slice(0,-1); 

  if (/^https?/.test(linkText)) {
    var anchor = linkText.split(/\s+/);
    var link = anchor.shift();
    current_tag["doc"] = current_tag["doc"].slice(0,-1) + 
                         "[" + anchor.join(" ") + "]" +
                         "(" + link + ")";
  }
  else { // sugar this into panino style [[ ]] link block
    current_tag["doc"] = current_tag["doc"].slice(0,-1) + 
                         "[[" + 
                         linkText
                         + "]] ";
  }

  skip_white();
}
642345
def parse_href(href):
    """"""
    url = urlparse(href)
    path = url.path.split('/')
    collection_name = path[1]
    id_ = path[2]
    return collection_name, id_
975809
def iter_links_script_element(self, element):
        ''''''
        if self.javascript_scraper and element.text:
            link_iter = self.javascript_scraper.scrape_links(element.text,
                                                             context=True)

            for link, context in link_iter:
                inline = is_likely_inline(link)

                if context is True:
                    link_type = None
                else:
                    link_type = context

                yield LinkInfo(
                    element=element, tag=element.tag, attrib=None,
                    link=link,
                    inline=inline, linked=not inline,
                    base_link=None,
                    value_type='script',
                    link_type=link_type
                )

        for link in self.iter_links_plain_element(element):
            yield link
1004606
def link_pantsrefs(soups, precomputed):
  """"""
  for (page, soup) in soups.items():
    for a in soup.find_all('a'):
      if not a.has_attr('pantsref'):
        continue
      pantsref = a['pantsref']
      if not pantsref in precomputed.pantsref:
        raise TaskError('Page {} has pantsref "{}" and I cannot find pantsmark for'
                        ' it'.format(page, pantsref))
      a['href'] = rel_href(page, precomputed.pantsref[pantsref])
821312
function getAttributeSet (attributes) {
  let attrs = {}
  Array.prototype.slice.apply(attributes).forEach(function (attr) {
    attrs[attr.name] = attr.value
  })
  return attrs
}
901966
public static Iterable<String> getAttributeNames(Iterable<Attribute> attrs) {
    return () -> stream(attrs).map(Attribute::getName).iterator();
  }
326190
def parse_pseudo_open(self, sel, name, has_selector, iselector, index):
        """"""

        flags = FLG_PSEUDO | FLG_OPEN
        if name == ':not':
            flags |= FLG_NOT
        if name == ':has':
            flags |= FLG_RELATIVE

        sel.selectors.append(self.parse_selectors(iselector, index, flags))
        has_selector = True
        return has_selector
492553
def _links(self):
        """"""
        total = 0.0
        for value in self.link.values():
            total += value
        return total
109982
def links(self):
        """"""
        for match in self._href_re.finditer(self.content):
            url = match.group(1) or match.group(2) or match.group(3)
            url = self.clean_link(urlparse.urljoin(self.base_url, url))
            yield Link(url, self)
1248348
def links(links = {})
      links.each_pair do |rel, uri|
        link rel, uri if uri
      end
    end
1113869
def iter_links(self):
        
        for x in range(self.width):
            for y in range(self.height):
                for link in Links:
                    if (x, y, link) in self:
                        yield (x, y, link)
1224017
def base_link(rel, self_rel=False):
    """"""
    link = _BASE_LINKS[rel].copy()
    link['rel'] = 'self' if self_rel else rel
    return link
585726
def findLinksRel(link_attrs_list, target_rel):
    """"""
    # XXX: TESTME
    matchesTarget = lambda attrs: linkHasRel(attrs, target_rel)
    return list(filter(matchesTarget, link_attrs_list))
1140960
def get_link_name (self, tag, attrs, attr):
        """"""
        if tag == 'a' and attr == 'href':
            # Look for name only up to MAX_NAMELEN characters
            data = self.parser.peek(MAX_NAMELEN)
            data = data.decode(self.parser.encoding, "ignore")
            name = linkname.href_name(data)
            if not name:
                name = attrs.get_true('title', u'')
        elif tag == 'img':
            name = attrs.get_true('alt', u'')
            if not name:
                name = attrs.get_true('title', u'')
        else:
            name = u""
        return name
817538
function parseLinks(target, resp) {
  target._links = parseLinkHeader(resp.headers.get('link'));
  target._linkTemplates = parseLinkHeader(resp.headers.get('link-template'));
  return resp
}