(self)
return result
Constructs the part in the summary that prints the edge list in an
        adjacency list format.
Constructs the part in the summary that prints the edge list in an
        adjacency list format.
Constructs the part in the summary that prints the edge list in an adjacency list format .
def _construct_edgelist_adjlist(self):
        """Constructs the part in the summary that prints the edge list in an
        adjacency list format."""
        result = [self._edges_header]

        if self._graph.vcount() == 0:
            return

        if self._graph.is_named():
            names = self._graph.vs["name"]
            maxlen = max(len(str(name)) for name in names)
            format_str = "%%%ds %s %%s" % (maxlen, self._arrow)
            for v1, name in enumerate(names):
                neis = self._graph.successors(v1)
                neis = ", ".join(str(names[v2]) for v2 in neis)
                result.append(format_str % (name, neis))
        else:
            maxlen = len(str(self._graph.vcount()))
            num_format = "%%%dd" % maxlen
            format_str = "%s %s %%s" % (num_format, self._arrow)
            for v1 in range(self._graph.vcount()):
                neis = self._graph.successors(v1)
                neis = " ".join(num_format % v2 for v2 in neis)
                result.append(format_str % (v1, neis))

        # Try to wrap into multiple columns if that works with the given width
        if self.width is not None:
            maxlen = max(len(line) for line in result[1:])
            colcount = int(self.width + 3) / int(maxlen + 3)
            if colcount > 1:
                # Rewrap to multiple columns
                nrows = len(result) - 1
                colheight = int(ceil(nrows / float(colcount)))
                newrows = [[] for _ in range(colheight)]
                for i, row in enumerate(result[1:]):
                    newrows[i % colheight].append(row.ljust(maxlen))
                result[1:] = ["   ".join(row) for row in newrows]

        return result
def _construct_edgelist_adjlist ( self ) : result = [ self . _edges_header ] if self . _graph . vcount ( ) == 0 : return if self . _graph . is_named ( ) : names = self . _graph . vs [ "name" ] maxlen = max ( len ( str ( name ) ) for name in names ) format_str = "%%%ds %s %%s" % ( maxlen , self . _arrow ) for v1 , name in enumerate ( names ) : neis = self . _graph . successors ( v1 ) neis = ", " . join ( str ( names [ v2 ] ) for v2 in neis ) result . append ( format_str % ( name , neis ) ) else : maxlen = len ( str ( self . _graph . vcount ( ) ) ) num_format = "%%%dd" % maxlen format_str = "%s %s %%s" % ( num_format , self . _arrow ) for v1 in range ( self . _graph . vcount ( ) ) : neis = self . _graph . successors ( v1 ) neis = " " . join ( num_format % v2 for v2 in neis ) result . append ( format_str % ( v1 , neis ) ) # Try to wrap into multiple columns if that works with the given width if self . width is not None : maxlen = max ( len ( line ) for line in result [ 1 : ] ) colcount = int ( self . width + 3 ) / int ( maxlen + 3 ) if colcount > 1 : # Rewrap to multiple columns nrows = len ( result ) - 1 colheight = int ( ceil ( nrows / float ( colcount ) ) ) newrows = [ [ ] for _ in range ( colheight ) ] for i , row in enumerate ( result [ 1 : ] ) : newrows [ i % colheight ] . append ( row . ljust ( maxlen ) ) result [ 1 : ] = [ "   " . join ( row ) for row in newrows ] return result