class_docstr: Class for generating a graph object from a dataset.
  
  Prepare Graph object from a dataset file.
  
  Parameters
  ----------
  graph_matrix_path : string
      Path to graph adjacency matrix.
  labels_path : string
      Path to labels of the nodes of the graph.
  
  Attributes
  ----------
  edges : dict
      Dictionary with node number as key
      and edge connected node numbers as values.
  n_nodes : int
      Number of nodes in the graph.
  labels : dict
      Dictionary with node number as key and the true label number as values.
class_docstr_tok: ["Class","for","generating","a","graph","object","from","a","dataset",".","Prepare","Graph","object","from","a","dataset","file",".","Parameters","--","--","--","--","--","graph_matrix_path",":","string","Path","to","graph","adjacency","matrix",".","labels_path",":","string","Path","to","labels","of","the","nodes","of","the","graph",".","Attributes","--","--","--","--","--","edges",":","dict","Dictionary","with","node","number","as","key","and","edge","connected","node","numbers","as","values",".","n_nodes",":","int","Number","of","nodes","in","the","graph",".","labels",":","dict","Dictionary","with","node","number","as","key","and","the","true","label","number","as","values","."]
code: def __init__(self, graph_matrix_path, labels_path):
      self.edges = {}
      with open(graph_matrix_path, "r") as edges_file:
          for i, line in enumerate(edges_file):
              lsp = line.split()
              self.edges[i] = [
                  k for k, value in enumerate(lsp) if int(value) == 1
              ]
  
      self.n_nodes = len(self.edges)
  
      if labels_path is not None:
          self.labels = {}
          with open(labels_path, "r") as labels_file:
              for i, line in enumerate(labels_file):
                  self.labels[i] = []
                  self.labels[i].append(int(line))
  
file_path: geomstats/geomstats/datasets/prepare_graph_data.py
imports: import logging
  import random
  import geomstats.backend
  from geomstats.geometry.poincare_ball import PoincareBall
label_desc: Use image node_id 1 to create a new Graph object  with example: obj = Graph(graph_matrix_path, labels_path)