class_docstr: Summary representation of a graph.
  
  The summary representation includes a header line and the list of
  edges. The header line consists of C{IGRAPH}, followed by a
  four-character long code, the number of vertices, the number of
  edges, two dashes (C{--}) and the name of the graph (i.e.
  the contents of the C{name} attribute, if any). For instance,
  a header line may look like this::
  
      IGRAPH U--- 4 5 --
  
  The four-character code describes some basic properties of the
  graph. The first character is C{U} if the graph is undirected,
  C{D} if it is directed. The second letter is C{N} if the graph
  has a vertex attribute called C{name}, or a dash otherwise. The
  third letter is C{W} if the graph is weighted (i.e. it has an
  edge attribute called C{weight}), or a dash otherwise. The
  fourth letter is C{B} if the graph has a vertex attribute called
  C{type}; this is usually used for bipartite graphs.
  
  Edges may be presented as an ordinary edge list or an adjacency
  list. By default, this depends on the number of edges; however,
  you can control it with the appropriate constructor arguments.
docstr: Constructs a summary representation of a graph.
  
  @param verbosity: the verbosity of the summary. If zero, only
    the header line will be returned. If one, the header line
    and the list of edges will both be returned.
  @param width: the maximal width of each line in the summary.
    C{None} means that no limit will be enforced.
  @param max_rows: the maximal number of rows to print in a single
    table (e.g., vertex attribute table or edge attribute table)
  @param edge_list_format: format of the edge list in the summary.
    Supported formats are: C{compressed}, C{adjlist}, C{edgelist},
    C{auto}, which selects automatically from the other three based
    on some simple criteria.
  @param print_graph_attributes: whether to print graph attributes
    if there are any.
  @param print_vertex_attributes: whether to print vertex attributes
    if there are any.
  @param print_edge_attributes: whether to print edge attributes
    if there are any.
  @param full: False has no effect; True turns on the attribute
    printing for graph, vertex and edge attributes with verbosity 1.
docstr_tok: ["Constructs","a","summary","representation","of","a","graph",".","@","param","verbosity",":","the","verbosity","of","the","summary",".","If","zero",",","only","the","header","line","will","be","returned",".","If","one",",","the","header","line","and","the","list","of","edges","will","both","be","returned",".","@","param","width",":","the","maximal","width","of","each","line","in","the","summary",".","C","{","None","}","means","that","no","limit","will","be","enforced",".","@","param","max_rows",":","the","maximal","number","of","rows","to","print","in","a","single","table","(","e.g.",",","vertex","attribute","table","or","edge","attribute","table",")","@","param","edge_list_format",":","format","of","the","edge","list","in","the","summary",".","Supported","formats","are",":","C","{","compressed","}",",","C","{","adjlist","}",",","C","{","edgelist","}",",","C","{","auto","}",",","which","selects","automatically","from","the","other","three","based","on","some","simple","criteria",".","@","param","print_graph_attributes",":","whether","to","print","graph","attributes","if","there","are","any",".","@","param","print_vertex_attributes",":","whether","to","print","vertex","attributes","if","there","are","any",".","@","param","print_edge_attributes",":","whether","to","print","edge","attributes","if","there","are","any",".","@","param","full",":","False","has","no","effect",";","True","turns","on","the","attribute","printing","for","graph",",","vertex","and","edge","attributes","with","verbosity","1","."]
code: def __init__(
      self,
      graph,
      verbosity=0,
      width=78,
      edge_list_format="auto",
      max_rows=99999,
      print_graph_attributes=False,
      print_vertex_attributes=False,
      print_edge_attributes=False,
      full=False,
  ):
      """Constructs a summary representation of a graph.
  
      @param verbosity: the verbosity of the summary. If zero, only
        the header line will be returned. If one, the header line
        and the list of edges will both be returned.
      @param width: the maximal width of each line in the summary.
        C{None} means that no limit will be enforced.
      @param max_rows: the maximal number of rows to print in a single
        table (e.g., vertex attribute table or edge attribute table)
      @param edge_list_format: format of the edge list in the summary.
        Supported formats are: C{compressed}, C{adjlist}, C{edgelist},
        C{auto}, which selects automatically from the other three based
        on some simple criteria.
      @param print_graph_attributes: whether to print graph attributes
        if there are any.
      @param print_vertex_attributes: whether to print vertex attributes
        if there are any.
      @param print_edge_attributes: whether to print edge attributes
        if there are any.
      @param full: False has no effect; True turns on the attribute
        printing for graph, vertex and edge attributes with verbosity 1.
      """
      if full:
          print_graph_attributes = True
          print_vertex_attributes = True
          print_edge_attributes = True
          verbosity = max(verbosity, 1)
  
      self._graph = graph
      self.edge_list_format = edge_list_format.lower()
      self.max_rows = int(max_rows)
      self.print_graph_attributes = print_graph_attributes
      self.print_vertex_attributes = print_vertex_attributes
      self.print_edge_attributes = print_edge_attributes
      self.verbosity = verbosity
      self.width = width
      self.wrapper = _get_wrapper_for_width(
          self.width, break_on_hyphens=False
      )
  
      if self._graph.is_named():
          self._edges_header = "+ edges (vertex names):"
      else:
          self._edges_header = "+ edges:"
      self._arrow = ["--", "->"][self._graph.is_directed()]
      self._arrow_format = "%%s%s%%s" % self._arrow
  
imports: import sys
  from igraph.statistics import median
  from itertools import islice
  from math import ceil
  from texttable import Texttable
  from textwrap import TextWrapper
label_desc: Use image node_id 1 to create a new GraphSummary object  with example: obj = GraphSummary(graph, verbosity, width, edge_list_format, max_rows, print_graph_attributes, print_vertex_attributes, print_edge_attributes, full)