class_docstr: Repurpose a dataset for standard graph property prediction task.
  
  The created dataset will include data needed for graph property prediction.
  Currently it only supports homogeneous graphs.
  
  The class converts a given dataset into a new dataset object such that:
  
    - It stores ``len(dataset)`` graphs.
    - The i-th graph and its label is accessible from ``dataset[i]``.
  
  The class will generate a train/val/test split if :attr:`split_ratio` is provided.
  The generated split will be cached to disk for fast re-loading. If the provided split
  ratio differs from the cached one, it will re-process the dataset properly.
  
  Parameters
  ----------
  dataset : DGLDataset
      The dataset to be converted.
  split_ratio : (float, float, float), optional
      Split ratios for training, validation and test sets. They must sum to one.
  
  Attributes
  ----------
  num_tasks : int
      Number of tasks to predict.
  num_classes : int
      Number of classes to predict per task, None for regression datasets.
  train_idx : Tensor
      An 1-D integer tensor of training node IDs.
  val_idx : Tensor
      An 1-D integer tensor of validation node IDs.
  test_idx : Tensor
      An 1-D integer tensor of test node IDs.
  node_feat_size : int
      Input node feature size, None if not applicable.
  edge_feat_size : int
      Input edge feature size, None if not applicable.
  
  Examples
  --------
  
  >>> from dgl.data import AsGraphPredDataset
  >>> from ogb.graphproppred import DglGraphPropPredDataset
  >>> dataset = DglGraphPropPredDataset(name='ogbg-molhiv')
  >>> new_dataset = AsGraphPredDataset(dataset)
  >>> print(new_dataset)
  Dataset("ogbg-molhiv-as-graphpred", num_graphs=41127, save_path=...)
  >>> print(len(new_dataset))
  41127
  >>> print(new_dataset[0])
  (Graph(num_nodes=19, num_edges=40,
         ndata_schemes={'feat': Scheme(shape=(9,), dtype=torch.int64)}
         edata_schemes={'feat': Scheme(shape=(3,), dtype=torch.int64)}), tensor([0]))
class_docstr_tok: ["Repurpose","a","dataset","for","standard","graph","property","prediction","task",".","The","created","dataset","will","include","data","needed","for","graph","property","prediction",".","Currently","it","only","supports","homogeneous","graphs",".","The","class","converts","a","given","dataset","into","a","new","dataset","object","such","that",":","-","It","stores","``","len","(","dataset",")","``","graphs",".","-","The","i-th","graph","and","its","label","is","accessible","from","``","dataset","[","i","]","``",".","The","class","will","generate","a","train\/val\/test","split","if",":","attr",":","`","split_ratio","`","is","provided",".","The","generated","split","will","be","cached","to","disk","for","fast","re-loading",".","If","the","provided","split","ratio","differs","from","the","cached","one",",","it","will","re-process","the","dataset","properly",".","Parameters","--","--","--","--","--","dataset",":","DGLDataset","The","dataset","to","be","converted",".","split_ratio",":","(","float",",","float",",","float",")",",","optional","Split","ratios","for","training",",","validation","and","test","sets",".","They","must","sum","to","one",".","Attributes","--","--","--","--","--","num_tasks",":","int","Number","of","tasks","to","predict",".","num_classes",":","int","Number","of","classes","to","predict","per","task",",","None","for","regression","datasets",".","train_idx",":","Tensor","An","1-D","integer","tensor","of","training","node","IDs",".","val_idx",":","Tensor","An","1-D","integer","tensor","of","validation","node","IDs",".","test_idx",":","Tensor","An","1-D","integer","tensor","of","test","node","IDs",".","node_feat_size",":","int","Input","node","feature","size",",","None","if","not","applicable",".","edge_feat_size",":","int","Input","edge","feature","size",",","None","if","not","applicable",".","Examples","--","--","--","--",">",">",">","from","dgl.data","import","AsGraphPredDataset",">",">",">","from","ogb.graphproppred","import","DglGraphPropPredDataset",">",">",">","dataset","=","DglGraphPropPredDataset","(","name='ogbg-molhiv","'",")",">",">",">","new_dataset","=","AsGraphPredDataset","(","dataset",")",">",">",">","print","(","new_dataset",")","Dataset","(","``","ogbg-molhiv-as-graphpred","''",",","num_graphs=41127",",","save_path=","...",")",">",">",">","print","(","len","(","new_dataset",")",")","41127",">",">",">","print","(","new_dataset","[","0","]",")","(","Graph","(","num_nodes=19",",","num_edges=40",",","ndata_schemes=","{","'feat","'",":","Scheme","(","shape=","(","9",",",")",",","dtype=torch.int64",")","}","edata_schemes=","{","'feat","'",":","Scheme","(","shape=","(","3",",",")",",","dtype=torch.int64",")","}",")",",","tensor","(","[","0","]",")",")"]
code: def __getitem__(self, idx):
      return self.dataset[idx]
  
imports: import json
  import os
  import numpy
  from ..None import backend
  from ..base import DGLError
  from ..convert import graph
  from ..sampling.negative import _calc_redundancy
  from .None import utils
  from .dgl_dataset import DGLDataset
label_desc: Use image node_id 6 for calling the AsGraphPredDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: self