class_docstr: A class for saving graphs and split in OGB-compatible manner
  Create submission_datasetname/ directory, and output the following two files:
      - datasetname.zip (OGB-compatible zipped dataset folder)
      - meta_dict.pt (torch files storing all the necessary dataset meta-information)
class_docstr_tok: ["A","class","for","saving","graphs","and","split","in","OGB-compatible","manner","Create","submission_datasetname\/","directory",",","and","output","the","following","two","files",":","-","datasetname.zip","(","OGB-compatible","zipped","dataset","folder",")","-","meta_dict.pt","(","torch","files","storing","all","the","necessary","dataset","meta-information",")"]
code: def __init__(
      self, dataset_name, is_hetero, version, root="submission"
  ):
      # verify input
      if not (
          "ogbn-" in dataset_name
          or "ogbl-" in dataset_name
          or "ogbg-" in dataset_name
      ):
          raise ValueError(
              "Dataset name must have valid ogb prefix (e.g., ogbn-*)."
          )
      if not isinstance(is_hetero, bool):
          raise ValueError("is_hetero must be of type bool.")
      if not (isinstance(version, int) and version >= 0):
          raise ValueError(
              "version must be of type int and non-negative"
          )
  
      self.dataset_name = dataset_name
  
      self.is_hetero = is_hetero
      self.version = version
      self.root = root
      self.dataset_prefix = dataset_name.split("-")[
          0
      ]  # specify the task category
      self.dataset_suffix = "_".join(dataset_name.split("-")[1:])
      self.submission_dir = (
          self.root
          + "_"
          + self.dataset_prefix
          + "_"
          + self.dataset_suffix
      )
      self.dataset_dir = osp.join(
          self.submission_dir, self.dataset_suffix
      )
      self.meta_dict_path = osp.join(
          self.submission_dir, "meta_dict.pt"
      )
  
      if self.dataset_prefix == "ogbg" and self.is_hetero:
          raise NotImplementedError(
              "Heterogeneous graph dataset object has not been implemented for graph property prediction yet."
          )
  
      if osp.exists(self.dataset_dir):
          if (
              input(
                  f"Found an existing submission directory at {self.submission_dir}/. \nWill you remove it? (y/N)\n"
              ).lower()
              == "y"
          ):
              shutil.rmtree(self.submission_dir)
              print("Removed existing submission directory")
          else:
              print("Process stopped.")
              exit(-1)
  
      # make necessary dirs
      self.raw_dir = osp.join(self.dataset_dir, "raw")
      os.makedirs(self.raw_dir, exist_ok=True)
      os.makedirs(
          osp.join(self.dataset_dir, "processed"), exist_ok=True
      )
  
      # create release note
      with open(
          osp.join(self.dataset_dir, f"RELEASE_v{version}.txt"), "w"
      ) as fw:
          fw.write(
              f"# Release note for {self.dataset_name}\n\n### v{version}: {date.today()}"
          )
  
      # check list
      self._save_graph_list_done = False
      self._save_split_done = False
      self._copy_mapping_dir_done = False
  
      if "ogbl" == self.dataset_prefix:
          self._save_target_labels_done = (
              True  # for ogbl, we do not need to give predicted labels
          )
      else:
          self._save_target_labels_done = (
              False  # for ogbn and ogbg, need to give predicted labels
          )
  
      self._save_task_info_done = False
      self._get_meta_dict_done = False
      self._zip_done = False
  
imports: import torch
  import pandas
  import os
  import os.path
  from datetime import date
  import shutil
  from tqdm.auto import tqdm
  import numpy
  from ogb.io.read_graph_raw import read_binary_graph_raw, read_binary_heterograph_raw
  from ogb.utils.torch_util import all_numpy
label_desc: Use image node_id 1 to create a new DatasetSaver object from inherited base classes: object with example: obj = DatasetSaver(dataset_name, is_hetero, version, root)