dict: trill link details
358631
def trill_links(self):
        
        xmlns = 'urn:brocade.com:mgmt:brocade-fabric-service'
        get_links_info = ET.Element('show-linkinfo', xmlns=xmlns)
        results = self._callback(get_links_info, handler='get')
        result = []
        for item in results.findall('{%s}show-link-info' % xmlns):
            src_rbridge_id = item.find('{%s}linkinfo-rbridgeid' % xmlns).text
            src_switch_wwn = item.find('{%s}linkinfo-wwn' % xmlns).text
            for link in item.findall('{%s}linkinfo-isl' % xmlns):
                dest_rbridge_id = link.find(
                    '{%s}linkinfo-isllink-destdomain' % xmlns).text
                src_interface = link.find(
                    '{%s}linkinfo-isllink-srcport-interface' % xmlns).text
                dest_interface = link.find(
                    '{%s}linkinfo-isllink-destport-interface' % xmlns).text
                link_cost = link.find('{%s}linkinfo-isl-linkcost' % xmlns).text
                link_cost_count = link.find(
                    '{%s}linkinfo-isllink-costcount' % xmlns).text

                item_results = {'source-rbridgeid': src_rbridge_id,
                                'source-switch-wwn': src_switch_wwn,
                                'dest-rbridgeid': dest_rbridge_id,
                                'source-interface': src_interface,
                                'dest-interface': dest_interface,
                                'link-cost': link_cost,
                                'link-costcount': link_cost_count}

                result.append(item_results)

        return result
383793
def explicit_rel_links(self, rels=('homepage', 'download')):
        """"""
        for match in self._rel_re.finditer(self.content):
            found_rels = match.group(1).lower().split()
            for rel in rels:
                if rel in found_rels:
                    break
            else:
                continue
            match = self._href_re.search(match.group(0))
            if not match:
                continue
            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)
762605
def _get_dict(lines, start_index, indentation, deep):
    """"""

    info = {}
    current_item = None

    i = start_index
    while i < len(lines):

        current_line = lines[i]
        current_line_indentation = _get_indentation(current_line)

        # Check for multi-level returns
        if current_line_indentation < indentation:
            return info, i-1

        if current_line_indentation == indentation:
            current_item = current_line.lstrip(' ')
            info[current_item] = {}
            i = i + 1
            continue

        if i < len(lines) - 1:
            next_line_indentation = _get_indentation(lines[i+1])
        else:
            next_line_indentation = current_line_indentation

        if next_line_indentation > current_line_indentation:
            ret_dict, i = _get_dict(lines, i, current_line_indentation, deep+1)
            for key in ret_dict.keys():
                if key in info[current_item]:
                    info[current_item][key].update(ret_dict[key])
                else:
                    info[current_item][key] = ret_dict[key]
        else:
            key, value = _get_key_value(current_line)
            if key:
                info[current_item][key] = value

        # Do not return if it's the top level of recursion
        if next_line_indentation < current_line_indentation and deep > 0:
            return info, i

        i = i + 1

    return info, i
823218
def link(self, rel):
        """"""
        for link in self.ln:
            if ('rel' in link and
                    link['rel'] == rel):
                return(link)
        return(None)
255074
def _set_suffix_links(self):
        '''
        
        '''
        self._suffix_links_set = True
        for current, parent in self.bfs():
            # skip the root node
            if parent is None:
                continue
            current.longest_prefix = parent.longest_prefix
            if parent.has_value:
                current.longest_prefix = parent
            # the root doesn't get a suffix link
            # also, skip previously set suffix links
            if current.has_suffix:
                continue
            # current is not the root and has no suffix
            # set current's suffix to parent's suffix
            suffix = parent
            while True:
                if not suffix.has_suffix:
                    current.suffix = self.root
                    break
                else:
                    suffix = suffix.suffix
                if current.uplink in suffix:
                    current.suffix = suffix[current.uplink]
                    break
            # now find the dict_suffix value
            suffix = current.suffix
            while not suffix.has_value and suffix.has_suffix:
                suffix = suffix.suffix
            if suffix.has_value:
                current.dict_suffix = suffix
205097
def link(text, link_func):
    """"""
    def object_formatter(v, c, m, p):
        """Format object view link."""
        return Markup('<a href="{0}">{1}</a>'.format(
            link_func(m), text))
    return object_formatter
1008152
def iter_links(self):
        # type: () -> Iterable[Link]
        """"""
        document = html5lib.parse(
            self.content,
            transport_encoding=_get_encoding_from_headers(self.headers),
            namespaceHTMLElements=False,
        )
        base_url = _determine_base_url(document, self.url)
        for anchor in document.findall(".//a"):
            if anchor.get("href"):
                href = anchor.get("href")
                url = _clean_link(urllib_parse.urljoin(base_url, href))
                pyrequire = anchor.get('data-requires-python')
                pyrequire = unescape(pyrequire) if pyrequire else None
                yield Link(url, self.url, requires_python=pyrequire)
165738
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'duration') and self.duration is not None:
            _dict['duration'] = self.duration
        if hasattr(self, 'name') and self.name is not None:
            _dict['name'] = self.name
        if hasattr(self, 'details') and self.details is not None:
            _dict['details'] = self.details._to_dict()
        if hasattr(self, 'status') and self.status is not None:
            _dict['status'] = self.status
        if hasattr(self, 'container') and self.container is not None:
            _dict['container'] = self.container._to_dict()
        if hasattr(self, 'audio') and self.audio is not None:
            _dict['audio'] = [x._to_dict() for x in self.audio]
        return _dict
435187
def description(self, *args):
        '''
        
        '''
        if len(args):
            self._str_desc = args[0]
        else:
            return self._str_desc
628056
def node_link_data(graph: BELGraph) -> Mapping[str, Any]:
    
    nodes = sorted(graph, key=methodcaller('as_bel'))

    mapping = dict(zip(nodes, count()))

    return {
        'directed': True,
        'multigraph': True,
        'graph': graph.graph.copy(),
        'nodes': [
            _augment_node(node)
            for node in nodes
        ],
        'links': [
            dict(chain(
                data.copy().items(),
                [('source', mapping[u]), ('target', mapping[v]), ('key', key)]
            ))
            for u, v, key, data in graph.edges(keys=True, data=True)
        ]
    }
800003
static public String getDictionaryDetail(PdfDictionary dic, int depth){
        StringBuffer builder = new StringBuffer();
        builder.append('(');
        List subDictionaries = new ArrayList();
        for (Iterator i = dic.getKeys().iterator(); i.hasNext(); ) {
            PdfName key = (PdfName)i.next();
            PdfObject val = dic.getDirectObject(key);
            if (val.isDictionary())
                subDictionaries.add(key);
            builder.append(key);
            builder.append('=');
            builder.append(val);
            builder.append(", ");
        }
        builder.setLength(builder.length()-2);
        builder.append(')');
        PdfName pdfSubDictionaryName;
        for (Iterator it = subDictionaries.iterator(); it.hasNext(); ) {
        	pdfSubDictionaryName = (PdfName)it.next();
            builder.append('\n');
            for(int i = 0; i < depth+1; i++){
                builder.append('\t');
            }
            builder.append("Subdictionary ");
            builder.append(pdfSubDictionaryName);
            builder.append(" = ");
            builder.append(getDictionaryDetail(dic.getAsDict(pdfSubDictionaryName), depth+1));
        }
        return builder.toString();
    }
1251434
def _GetLink(self):
    
    if self._link is None:
      if self._tar_info:
        self._link = self._tar_info.linkname

    return self._link
246222
def _relIndexLink(self):
        """"""
        return os.path.join("..", os.path.basename(self.pathname), "index.html")
982612
def links(self, base_link, current_page) -> dict:
        
        max_pages = self.max_pages - 1 if \
            self.max_pages > 0 else self.max_pages
        base_link = '/%s' % (base_link.strip("/"))
        self_page = current_page
        prev = current_page - 1 if current_page is not 0 else None
        prev_link = '%s/page/%s/%s' % (base_link, prev, self.limit) if \
            prev is not None else None
        next = current_page + 1 if current_page < max_pages else None
        next_link = '%s/page/%s/%s' % (base_link, next, self.limit) if \
            next is not None else None
        first = 0
        last = max_pages
        return {
            'self': '%s/page/%s/%s' % (base_link, self_page, self.limit),
            'prev': prev_link,
            'next': next_link,
            'first': '%s/page/%s/%s' % (base_link, first, self.limit),
            'last': '%s/page/%s/%s' % (base_link, last, self.limit),
        }
743108
def details_handler(args):
    

    repo = _open_repo(args)
    _, anchor = _get_anchor(repo, args['<anchor-id>'])

    print("""path: {file_path}
encoding: {encoding}

[before]
{before}
--------------

[topic]
{topic}
--------------

[after]
{after}
--------------

offset: {offset}
width: {width}""".format(
        file_path=anchor.file_path,
        encoding=anchor.encoding,
        before=anchor.context.before,
        topic=anchor.context.topic,
        after=anchor.context.after,
        offset=anchor.context.offset,
        width=anchor.context.width))

    return ExitCode.OK
443234
def set_link(self):
        """"""
        try:
            self.link = self.soup.find('link').string
        except AttributeError:
            self.link = None
146800
def link_href(self, rel):
        """"""
        link = self.link(rel)
        if (link is not None):
            link = link['href']
        return(link)