class_docstr: Dataset base class for creating graph datasets.
  See `here <https://pytorch-geometric.readthedocs.io/en/latest/tutorial/
  create_dataset.html>`__ for the accompanying tutorial.
  
  Args:
      root (str, optional): Root directory where the dataset should be saved.
          (optional: :obj:`None`)
      transform (callable, optional): A function/transform that takes in a
          :class:`~torch_geometric.data.Data` or
          :class:`~torch_geometric.data.HeteroData` object and returns a
          transformed version.
          The data object will be transformed before every access.
          (default: :obj:`None`)
      pre_transform (callable, optional): A function/transform that takes in
          a :class:`~torch_geometric.data.Data` or
          :class:`~torch_geometric.data.HeteroData` object and returns a
          transformed version.
          The data object will be transformed before being saved to disk.
          (default: :obj:`None`)
      pre_filter (callable, optional): A function that takes in a
          :class:`~torch_geometric.data.Data` or
          :class:`~torch_geometric.data.HeteroData` object and returns a
          boolean value, indicating whether the data object should be
          included in the final dataset. (default: :obj:`None`)
      log (bool, optional): Whether to print any console output while
          downloading and processing the dataset. (default: :obj:`True`)
      force_reload (bool, optional): Whether to re-process the dataset.
          (default: :obj:`False`)
class_docstr_tok: ["Dataset","base","class","for","creating","graph","datasets",".","See","`","here","<","https",":","\/\/pytorch-geometric.readthedocs.io\/en\/latest\/tutorial\/","create_dataset.html",">","`","__","for","the","accompanying","tutorial",".","Args",":","root","(","str",",","optional",")",":","Root","directory","where","the","dataset","should","be","saved",".","(","optional",":",":","obj",":","`","None","`",")","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","a",":","class",":","`","~torch_geometric.data.Data","`","or",":","class",":","`","~torch_geometric.data.HeteroData","`","object","and","returns","a","transformed","version",".","The","data","object","will","be","transformed","before","every","access",".","(","default",":",":","obj",":","`","None","`",")","pre_transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","a",":","class",":","`","~torch_geometric.data.Data","`","or",":","class",":","`","~torch_geometric.data.HeteroData","`","object","and","returns","a","transformed","version",".","The","data","object","will","be","transformed","before","being","saved","to","disk",".","(","default",":",":","obj",":","`","None","`",")","pre_filter","(","callable",",","optional",")",":","A","function","that","takes","in","a",":","class",":","`","~torch_geometric.data.Data","`","or",":","class",":","`","~torch_geometric.data.HeteroData","`","object","and","returns","a","boolean","value",",","indicating","whether","the","data","object","should","be","included","in","the","final","dataset",".","(","default",":",":","obj",":","`","None","`",")","log","(","bool",",","optional",")",":","Whether","to","print","any","console","output","while","downloading","and","processing","the","dataset",".","(","default",":",":","obj",":","`","True","`",")","force_reload","(","bool",",","optional",")",":","Whether","to","re-process","the","dataset",".","(","default",":",":","obj",":","`","False","`",")"]
docstr: In case :obj:`idx` is of type integer, will return the data object
  at index :obj:`idx` (and transforms it in case :obj:`transform` is
  present).
  In case :obj:`idx` is a slicing object, *e.g.*, :obj:`[2:5]`, a list, a
  tuple, or a :obj:`torch.Tensor` or :obj:`np.ndarray` of type long or
  bool, will return a subset of the dataset at the specified indices.
docstr_tok: ["In","case",":","obj",":","`","idx","`","is","of","type","integer",",","will","return","the","data","object","at","index",":","obj",":","`","idx","`","(","and","transforms","it","in","case",":","obj",":","`","transform","`","is","present",")",".","In","case",":","obj",":","`","idx","`","is","a","slicing","object",",","*","e.g",".","*",",",":","obj",":","`","[","2:5","]","`",",","a","list",",","a","tuple",",","or","a",":","obj",":","`","torch.Tensor","`","or",":","obj",":","`","np.ndarray","`","of","type","long","or","bool",",","will","return","a","subset","of","the","dataset","at","the","specified","indices","."]
code: def __getitem__(
      self,
      idx: Union[int, np.integer, IndexType],
  ) -> Union["Dataset", BaseData]:
      r"""In case :obj:`idx` is of type integer, will return the data object
      at index :obj:`idx` (and transforms it in case :obj:`transform` is
      present).
      In case :obj:`idx` is a slicing object, *e.g.*, :obj:`[2:5]`, a list, a
      tuple, or a :obj:`torch.Tensor` or :obj:`np.ndarray` of type long or
      bool, will return a subset of the dataset at the specified indices.
      """
      if (
          isinstance(idx, (int, np.integer))
          or (isinstance(idx, Tensor) and idx.dim() == 0)
          or (isinstance(idx, np.ndarray) and np.isscalar(idx))
      ):
          data = self.get(self.indices()[idx])
          data = (
              data if self.transform is None else self.transform(data)
          )
          return data
  
      else:
          return self.index_select(idx)
  
imports: import copy
  import os.path
  import re
  import sys
  import warnings
  from abc import ABC, abstractmethod
  from collections.abc import Sequence
  from typing import Any, Callable, Iterable, Iterator, List, Optional, Tuple, Union
  import numpy
  import torch.utils.data
  from torch import Tensor
  from torch_geometric.data.data import BaseData
  from torch_geometric.io import fs
label_desc: Use image node_id 23 for calling the Dataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: data, self