class_docstr: A plain python object modeling a list of :class:`deepsnap.graph.Graph` 
  objects with various (optional) attributes.
  
  Args:
      graphs (list, optional): A list of :class:`deepsnap.graph.Graph`.
      task (str): The task that this :class:`GraphDataset` is used for
          (task = `node` or `edge` or `link_pred` or `graph`).
      custom_split_graphs (list): A list of 2 (train and val)
          or 3 (train, val and test) lists of splitted graphs, used in
          custom split of the `graph` task.
      edge_negative_sampling_ratio (float): The number of negative
          samples compared to that of positive edges. Default value 
          is 1.
      edge_message_ratio (float): The number of message passing edges
          compared to that of training supervision edges. Default value 
          is 0.8.
      edge_train_mode (str): Use `all` or `disjoint`. In `all` 
          mode, training supervision edges are same with the message 
          passing edges. In `disjoint` mode, training supervision 
          objectives are different from the message passing edges. 
          The difference between these two modes please see 
          the `DeepSNAP link prediction Colab <https://colab.research.
          google.com/drive/1ycdlJuse7l2De7wi51lFd_nCuaWgVABc?
          usp=sharing>`_.
      edge_split_mode (str): Use `exact` or `approximate`. This mode is 
          designed for the heterogeneous graph. If the mode is `exact`, 
          split the heterogeneous graph according to both the ratio
          and the split type. If the mode is `approximate`, split the 
          heterogeneous graph regardless of the split type.
      minimum_node_per_graph (int): If the number of nodes of a graph
          is smaller than the minimum node per graph, that graph will 
          be filtered out.
      generator (:class:`Generator`): The dataset will be on-the-fly 
          generated. The on-the-fly generator will be used, if the 
          :obj:`self.graphs` is empty or `None`, and the generator 
          (:class:`Generator`) is provided with an overwritten 
          :meth:`generate` method.
      resample_negatives (bool): Whether to resample negative edges in
          each iteration of the `link_pred` task. User needs to set this
          variable in the case of tensor backend for the custom split.
      resample_disjoint (bool): Whether to resample disjoint training 
          edges in the `disjonint` `link_pred` task.
      resample_disjoint_period (int): The number of iterations after
          which the training edges in the `disjoint` mode are resampled.
      negative_label_val (int, optional): The value of negative edges 
          generated in link_pred task. User needs to set this variable 
          in the case of tensor backend custom split.
      netlib (types.ModuleType, optional): The graph backend module. 
          Currently DeepSNAP supports the NetworkX and SnapX (for 
          SnapX only the undirected homogeneous graph) as the graph 
          backend. Default graph backend is the NetworkX.
class_docstr_tok: ["A","plain","python","object","modeling","a","list","of",":","class",":","`","deepsnap.graph.Graph","`","objects","with","various","(","optional",")","attributes",".","Args",":","graphs","(","list",",","optional",")",":","A","list","of",":","class",":","`","deepsnap.graph.Graph","`",".","task","(","str",")",":","The","task","that","this",":","class",":","`","GraphDataset","`","is","used","for","(","task","=","`","node","`","or","`","edge","`","or","`","link_pred","`","or","`","graph","`",")",".","custom_split_graphs","(","list",")",":","A","list","of","2","(","train","and","val",")","or","3","(","train",",","val","and","test",")","lists","of","splitted","graphs",",","used","in","custom","split","of","the","`","graph","`","task",".","edge_negative_sampling_ratio","(","float",")",":","The","number","of","negative","samples","compared","to","that","of","positive","edges",".","Default","value","is","1.","edge_message_ratio","(","float",")",":","The","number","of","message","passing","edges","compared","to","that","of","training","supervision","edges",".","Default","value","is","0.8.","edge_train_mode","(","str",")",":","Use","`","all","`","or","`","disjoint","`",".","In","`","all","`","mode",",","training","supervision","edges","are","same","with","the","message","passing","edges",".","In","`","disjoint","`","mode",",","training","supervision","objectives","are","different","from","the","message","passing","edges",".","The","difference","between","these","two","modes","please","see","the","`","DeepSNAP","link","prediction","Colab","<","https",":","\/\/colab.research",".","google.com\/drive\/1ycdlJuse7l2De7wi51lFd_nCuaWgVABc","?","usp=sharing",">","`","_",".","edge_split_mode","(","str",")",":","Use","`","exact","`","or","`","approximate","`",".","This","mode","is","designed","for","the","heterogeneous","graph",".","If","the","mode","is","`","exact","`",",","split","the","heterogeneous","graph","according","to","both","the","ratio","and","the","split","type",".","If","the","mode","is","`","approximate","`",",","split","the","heterogeneous","graph","regardless","of","the","split","type",".","minimum_node_per_graph","(","int",")",":","If","the","number","of","nodes","of","a","graph","is","smaller","than","the","minimum","node","per","graph",",","that","graph","will","be","filtered","out",".","generator","(",":","class",":","`","Generator","`",")",":","The","dataset","will","be","on-the-fly","generated",".","The","on-the-fly","generator","will","be","used",",","if","the",":","obj",":","`","self.graphs","`","is","empty","or","`","None","`",",","and","the","generator","(",":","class",":","`","Generator","`",")","is","provided","with","an","overwritten",":","meth",":","`","generate","`","method",".","resample_negatives","(","bool",")",":","Whether","to","resample","negative","edges","in","each","iteration","of","the","`","link_pred","`","task",".","User","needs","to","set","this","variable","in","the","case","of","tensor","backend","for","the","custom","split",".","resample_disjoint","(","bool",")",":","Whether","to","resample","disjoint","training","edges","in","the","`","disjonint","`","`","link_pred","`","task",".","resample_disjoint_period","(","int",")",":","The","number","of","iterations","after","which","the","training","edges","in","the","`","disjoint","`","mode","are","resampled",".","negative_label_val","(","int",",","optional",")",":","The","value","of","negative","edges","generated","in","link_pred","task",".","User","needs","to","set","this","variable","in","the","case","of","tensor","backend","custom","split",".","netlib","(","types.ModuleType",",","optional",")",":","The","graph","backend","module",".","Currently","DeepSNAP","supports","the","NetworkX","and","SnapX","(","for","SnapX","only","the","undirected","homogeneous","graph",")","as","the","graph","backend",".","Default","graph","backend","is","the","NetworkX","."]
docstr: Returns the node feature dimension.
  
  Returns:
      int: The node feature dimension for the graphs 
      in the dataset.
docstr_tok: ["Returns","the","node","feature","dimension",".","Returns",":","int",":","The","node","feature","dimension","for","the","graphs","in","the","dataset","."]
code: def num_node_features(self) -> int:
      r"""
      Returns the node feature dimension.
  
      Returns:
          int: The node feature dimension for the graphs
          in the dataset.
      """
      return self._graph_example.num_node_features
  
imports: import copy
  import math
  import types
  import random
  import networkx
  import numpy
  import torch
  import deepsnap
  from deepsnap.graph import Graph
  from deepsnap.hetero_graph import HeteroGraph
  import pdb
  from typing import Dict, List, Union
  import warnings
label_desc: Use image node_id 4 for calling the GraphDataset obj's underlying member method code with example usage: obj.num_node_features() and returns: self