class_docstr: Generic graph.
  
  This class is built on top of L{GraphBase}, so the order of the
  methods in the generated API documentation is a little bit obscure:
  inherited methods come after the ones implemented directly in the
  subclass. L{Graph} provides many functions that L{GraphBase} does not,
  mostly because these functions are not speed critical and they were
  easier to implement in Python than in pure C. An example is the
  attribute handling in the constructor: the constructor of L{Graph}
  accepts three dictionaries corresponding to the graph, vertex and edge
  attributes while the constructor of L{GraphBase} does not. This extension
  was needed to make L{Graph} serializable through the C{pickle} module.
  L{Graph} also overrides some functions from L{GraphBase} to provide a
  more convenient interface; e.g., layout functions return a L{Layout}
  instance from L{Graph} instead of a list of coordinate pairs.
  
  Graphs can also be indexed by strings or pairs of vertex indices or vertex
  names.  When a graph is indexed by a string, the operation translates to
  the retrieval, creation, modification or deletion of a graph attribute:
  
    >>> g = Graph.Full(3)
    >>> g["name"] = "Triangle graph"
    >>> g["name"]
    'Triangle graph'
    >>> del g["name"]
  
  When a graph is indexed by a pair of vertex indices or names, the graph
  itself is treated as an adjacency matrix and the corresponding cell of
  the matrix is returned:
  
    >>> g = Graph.Full(3)
    >>> g.vs["name"] = ["A", "B", "C"]
    >>> g[1, 2]
    1
    >>> g["A", "B"]
    1
    >>> g["A", "B"] = 0
    >>> g.ecount()
    2
  
  Assigning values different from zero or one to the adjacency matrix will
  be translated to one, unless the graph is weighted, in which case the
  numbers will be treated as weights:
  
    >>> g.is_weighted()
    False
    >>> g["A", "B"] = 2
    >>> g["A", "B"]
    1
    >>> g.es["weight"] = 1.0
    >>> g.is_weighted()
    True
    >>> g["A", "B"] = 2
    >>> g["A", "B"]
    2
    >>> g.es["weight"]
    [1.0, 1.0, 2]
docstr: __init__(n=0, edges=None, directed=False, graph_attrs=None,
  vertex_attrs=None, edge_attrs=None)
  
  Constructs a graph from scratch.
  
  @keyword n: the number of vertices. Can be omitted, the default is
    zero. Note that if the edge list contains vertices with indexes
    larger than or equal to M{n}, then the number of vertices will
    be adjusted accordingly.
  @keyword edges: the edge list where every list item is a pair of
    integers. If any of the integers is larger than M{n-1}, the number
    of vertices is adjusted accordingly. C{None} means no edges.
  @keyword directed: whether the graph should be directed
  @keyword graph_attrs: the attributes of the graph as a dictionary.
  @keyword vertex_attrs: the attributes of the vertices as a dictionary.
    The keys of the dictionary must be the names of the attributes; the
    values must be iterables with exactly M{n} items where M{n} is the
    number of vertices.
  @keyword edge_attrs: the attributes of the edges as a dictionary. The
    keys of the dictionary must be the names of the attributes; the values
    must be iterables with exactly M{m} items where M{m} is the number of
    edges.
docstr_tok: ["__init__","(","n=0",",","edges=None",",","directed=False",",","graph_attrs=None",",","vertex_attrs=None",",","edge_attrs=None",")","Constructs","a","graph","from","scratch",".","@","keyword","n",":","the","number","of","vertices",".","Can","be","omitted",",","the","default","is","zero",".","Note","that","if","the","edge","list","contains","vertices","with","indexes","larger","than","or","equal","to","M","{","n","}",",","then","the","number","of","vertices","will","be","adjusted","accordingly",".","@","keyword","edges",":","the","edge","list","where","every","list","item","is","a","pair","of","integers",".","If","any","of","the","integers","is","larger","than","M","{","n-1","}",",","the","number","of","vertices","is","adjusted","accordingly",".","C","{","None","}","means","no","edges",".","@","keyword","directed",":","whether","the","graph","should","be","directed","@","keyword","graph_attrs",":","the","attributes","of","the","graph","as","a","dictionary",".","@","keyword","vertex_attrs",":","the","attributes","of","the","vertices","as","a","dictionary",".","The","keys","of","the","dictionary","must","be","the","names","of","the","attributes",";","the","values","must","be","iterables","with","exactly","M","{","n","}","items","where","M","{","n","}","is","the","number","of","vertices",".","@","keyword","edge_attrs",":","the","attributes","of","the","edges","as","a","dictionary",".","The","keys","of","the","dictionary","must","be","the","names","of","the","attributes",";","the","values","must","be","iterables","with","exactly","M","{","m","}","items","where","M","{","m","}","is","the","number","of","edges","."]
code: def __init__(self, *args, **kwds):
      """__init__(n=0, edges=None, directed=False, graph_attrs=None,
      vertex_attrs=None, edge_attrs=None)
  
      Constructs a graph from scratch.
  
      @keyword n: the number of vertices. Can be omitted, the default is
        zero. Note that if the edge list contains vertices with indexes
        larger than or equal to M{n}, then the number of vertices will
        be adjusted accordingly.
      @keyword edges: the edge list where every list item is a pair of
        integers. If any of the integers is larger than M{n-1}, the number
        of vertices is adjusted accordingly. C{None} means no edges.
      @keyword directed: whether the graph should be directed
      @keyword graph_attrs: the attributes of the graph as a dictionary.
      @keyword vertex_attrs: the attributes of the vertices as a dictionary.
        The keys of the dictionary must be the names of the attributes; the
        values must be iterables with exactly M{n} items where M{n} is the
        number of vertices.
      @keyword edge_attrs: the attributes of the edges as a dictionary. The
        keys of the dictionary must be the names of the attributes; the values
        must be iterables with exactly M{m} items where M{m} is the number of
        edges.
      """
      # Pop the special __ptr keyword argument
      ptr = kwds.pop("__ptr", None)
  
      # Set up default values for the parameters. This should match the order
      # in *args
      kwd_order = (
          "n",
          "edges",
          "directed",
          "graph_attrs",
          "vertex_attrs",
          "edge_attrs",
      )
      params = [0, [], False, {}, {}, {}]
  
      # Is there any keyword argument in kwds that we don't know? If so,
      # freak out.
      unknown_kwds = set(kwds.keys())
      unknown_kwds.difference_update(kwd_order)
      if unknown_kwds:
          raise TypeError(
              "{0}.__init__ got an unexpected keyword argument {1!r}".format(
                  self.__class__.__name__, unknown_kwds.pop()
              )
          )
  
      # If the first argument is a list or any other iterable, assume that
      # the number of vertices were omitted
      args = list(args)
      if len(args) > 0 and hasattr(args[0], "__iter__"):
          args.insert(0, params[0])
  
      # Override default parameters from args
      params[: len(args)] = args
  
      # Override default parameters from keywords
      for idx, k in enumerate(kwd_order):
          if k in kwds:
              params[idx] = kwds[k]
  
      # Now, translate the params list to argument names
      (
          nverts,
          edges,
          directed,
          graph_attrs,
          vertex_attrs,
          edge_attrs,
      ) = params
  
      # When the number of vertices is None, assume that the user meant zero
      if nverts is None:
          nverts = 0
  
      # When 'edges' is None, assume that the user meant an empty list
      if edges is None:
          edges = []
  
      # When 'edges' is a NumPy array or matrix, convert it into a memoryview
      # as the lower-level C API works with memoryviews only
      try:
          from numpy import ndarray, matrix
  
          if isinstance(edges, (ndarray, matrix)):
              edges = numpy_to_contiguous_memoryview(edges)
      except ImportError:
          pass
  
      # Initialize the graph
      if ptr:
          super().__init__(__ptr=ptr)
      else:
          super().__init__(nverts, edges, directed)
  
      # Set the graph attributes
      for key, value in graph_attrs.items():
          if isinstance(key, int):
              key = str(key)
          self[key] = value
      # Set the vertex attributes
      for key, value in vertex_attrs.items():
          if isinstance(key, int):
              key = str(key)
          self.vs[key] = value
      # Set the edge attributes
      for key, value in edge_attrs.items():
          if isinstance(key, int):
              key = str(key)
          self.es[key] = value
  
imports: from igraph._igraph import ADJ_DIRECTED, ADJ_LOWER, ADJ_MAX, ADJ_MIN, ADJ_PLUS, ADJ_UNDIRECTED, ADJ_UPPER, ALL, ARPACKOptions, BFSIter, BLISS_F, BLISS_FL, BLISS_FLM, BLISS_FM, BLISS_FS, BLISS_FSM, DFSIter, Edge, GET_ADJACENCY_BOTH, GET_ADJACENCY_LOWER, GET_ADJACENCY_UPPER, GraphBase, IN, InternalError, OUT, REWIRING_SIMPLE, REWIRING_SIMPLE_LOOPS, STAR_IN, STAR_MUTUAL, STAR_OUT, STAR_UNDIRECTED, STRONG, TRANSITIVITY_NAN, TRANSITIVITY_ZERO, TREE_IN, TREE_OUT, TREE_UNDIRECTED, Vertex, WEAK, arpack_options, community_to_membership, convex_hull, is_bigraphical, is_degree_sequence, is_graphical, is_graphical_degree_sequence, set_progress_handler, set_random_number_generator, set_status_handler, umap_compute_weights, __igraph_version__
  from igraph.adjacency import _get_adjacency, _get_adjacency_sparse, _get_adjlist, _get_biadjacency, _get_inclist
  from igraph.automorphisms import _count_automorphisms_vf2, _get_automorphisms_vf2
  from igraph.basic import _add_edge, _add_edges, _add_vertex, _add_vertices, _delete_edges, _clear, _as_directed, _as_undirected
  from igraph.bipartite import _maximum_bipartite_matching, _bipartite_projection, _bipartite_projection_size
  from igraph.community import _community_fastgreedy, _community_infomap, _community_leading_eigenvector, _community_label_propagation, _community_multilevel, _community_optimal_modularity, _community_edge_betweenness, _community_spinglass, _community_walktrap, _k_core, _community_leiden, _modularity
  from igraph.clustering import Clustering, VertexClustering, Dendrogram, VertexDendrogram, Cover, VertexCover, CohesiveBlocks, compare_communities, split_join_distance, _biconnected_components, _cohesive_blocks, _connected_components, _clusters
  from igraph.cut import Cut, Flow, _all_st_cuts, _all_st_mincuts, _gomory_hu_tree, _maxflow, _mincut, _st_mincut
  from igraph.configuration import Configuration, init
  from igraph.drawing import BoundingBox, CairoGraphDrawer, DefaultGraphDrawer, MatplotlibGraphDrawer, Plot, Point, Rectangle, plot
  from igraph.drawing.colors import Palette, GradientPalette, AdvancedGradientPalette, RainbowPalette, PrecalculatedPalette, ClusterColoringPalette, color_name_to_rgb, color_name_to_rgba, hsv_to_rgb, hsva_to_rgba, hsl_to_rgb, hsla_to_rgba, rgb_to_hsv, rgba_to_hsva, rgb_to_hsl, rgba_to_hsla, palettes, known_colors
  from igraph.drawing.graph import __plot__
  from igraph.drawing.utils import autocurve
  from igraph.datatypes import Matrix, DyadCensus, TriadCensus, UniqueIdGenerator
  from igraph.formula import construct_graph_from_formula
  from igraph.io import _format_mapping
  from igraph.io.files import _construct_graph_from_graphmlz_file, _construct_graph_from_dimacs_file, _construct_graph_from_pickle_file, _construct_graph_from_picklez_file, _construct_graph_from_adjacency_file, _construct_graph_from_file, _write_graph_to_adjacency_file, _write_graph_to_dimacs_file, _write_graph_to_graphmlz_file, _write_graph_to_pickle_file, _write_graph_to_picklez_file, _write_graph_to_file
  from igraph.io.objects import _construct_graph_from_dict_list, _export_graph_to_dict_list, _construct_graph_from_tuple_list, _export_graph_to_tuple_list, _construct_graph_from_list_dict, _export_graph_to_list_dict, _construct_graph_from_dict_dict, _export_graph_to_dict_dict, _construct_graph_from_dataframe, _export_vertex_dataframe, _export_edge_dataframe
  from igraph.io.adjacency import _construct_graph_from_adjacency, _construct_graph_from_weighted_adjacency
  from igraph.io.libraries import _construct_graph_from_networkx, _export_graph_to_networkx, _construct_graph_from_graph_tool, _export_graph_to_graph_tool
  from igraph.io.random import _construct_random_geometric_graph
  from igraph.io.bipartite import _construct_bipartite_graph, _construct_bipartite_graph_from_adjacency, _construct_full_bipartite_graph, _construct_random_bipartite_graph
  from igraph.io.images import _write_graph_to_svg
  from igraph.layout import Layout, _layout, _layout_auto, _layout_sugiyama, _layout_method_wrapper, _3d_version_for, _layout_mapping
  from igraph.matching import Matching
  from igraph.operators import disjoint_union, union, intersection, operator_method_registry
  from igraph.seq import EdgeSeq, VertexSeq, _add_proxy_methods
  from igraph.statistics import FittedPowerLaw, Histogram, RunningMean, mean, median, percentile, quantile, power_law_fit
  from igraph.structural import _indegree, _outdegree, _degree_distribution, _pagerank, _shortest_paths
  from igraph.summary import GraphSummary, summary
  from igraph.utils import deprecated, numpy_to_contiguous_memoryview, rescale
  from igraph.version import __version__, __version_info__
  import os
  import sys
label_desc: Use image node_id 1 to create a new Graph object from inherited base classes: GraphBase with example: obj = Graph()