class_docstr: ArXiv dataset implementation.
  
  Args:
  
      np_random_seed (int): The random seed for numpy.
  
  Attributes:
  
      graph (pgl.Graph): The :code:`Graph` data object.
class_docstr_tok: ["ArXiv","dataset","implementation",".","Args",":","np_random_seed","(","int",")",":","The","random","seed","for","numpy",".","Attributes",":","graph","(","pgl.Graph",")",":","The",":","code",":","`","Graph","`","data","object","."]
code: def _load_data(self):
      np.random.seed(self.np_random_seed)
      edge_path = os.path.join(self.path, "ca-AstroPh.txt")
  
      bi_edges = set()
      self.neg_edges = []
      self.pos_edges = []
      self.node2id = dict()
  
      def node_id(node):
          if node not in self.node2id:
              self.node2id[node] = len(self.node2id)
          return self.node2id[node]
  
      with io.open(edge_path) as inf:
          for _ in range(4):
              inf.readline()
          for line in inf:
              u, v = line.strip("\n").split("\t")
              u, v = node_id(u), node_id(v)
              if u < v:
                  bi_edges.add((u, v))
              else:
                  bi_edges.add((v, u))
  
      num_nodes = len(self.node2id)
  
      while len(self.neg_edges) < len(bi_edges) // 2:
          random_edges = np.random.choice(num_nodes, [len(bi_edges), 2])
          for u, v in random_edges:
              if (
                  u != v
                  and (u, v) not in bi_edges
                  and (v, u) not in bi_edges
              ):
                  self.neg_edges.append((u, v))
                  if len(self.neg_edges) == len(bi_edges) // 2:
                      break
  
      bi_edges = list(bi_edges)
      np.random.shuffle(bi_edges)
      self.pos_edges = bi_edges[: len(bi_edges) // 2]
      bi_edges = bi_edges[len(bi_edges) // 2 :]
      all_edges = []
      for edge in bi_edges:
          u, v = edge
          all_edges.append((u, v))
          all_edges.append((v, u))
      self.graph = Graph(num_nodes=num_nodes, edges=all_edges)
  
imports: import os
  import io
  import sys
  import numpy
  import pickle
  from pgl.graph import Graph
label_desc: Use image node_id 2 for calling the ArXivDataset obj's underlying member method code with example usage: obj._load_data() and returns: self