class_docstr: 1. Generate positive and negative samples
  2. Subgraph sampling
  
  Attributes:
      g(dgl.DGLGraph): graph
      split_edge(dict): split edge
      hop(int): num of hop
      neg_samples(int): num of negative samples per positive sample
      subsample_ratio(float): ratio of subsample
      use_coalesce(bool): True for coalesce graph. Graph with multi-edge need to coalesce
class_docstr_tok: ["1",".","Generate","positive","and","negative","samples","2",".","Subgraph","sampling","Attributes",":","g","(","dgl.DGLGraph",")",":","graph","split_edge","(","dict",")",":","split","edge","hop","(","int",")",":","num","of","hop","neg_samples","(","int",")",":","num","of","negative","samples","per","positive","sample","subsample_ratio","(","float",")",":","ratio","of","subsample","use_coalesce","(","bool",")",":","True","for","coalesce","graph",".","Graph","with","multi-edge","need","to","coalesce"]
code: def __init__(
      self,
      g,
      split_edge,
      hop=1,
      neg_samples=1,
      subsample_ratio=1,
      prefix=None,
      save_dir=None,
      num_workers=32,
      shuffle=True,
      use_coalesce=True,
      print_fn=print,
  ):
      self.g = g
      self.hop = hop
      self.subsample_ratio = subsample_ratio
      self.prefix = prefix
      self.save_dir = save_dir
      self.print_fn = print_fn
  
      self.generator = PosNegEdgesGenerator(
          g=self.g,
          split_edge=split_edge,
          neg_samples=neg_samples,
          subsample_ratio=subsample_ratio,
          shuffle=shuffle,
      )
      if use_coalesce:
          for k, v in g.edata.items():
              g.edata[
                  k
              ] = v.float()  # dgl.to_simple() requires data is float
          self.g = dgl.to_simple(
              g, copy_ndata=True, copy_edata=True, aggregator="sum"
          )
  
      self.ndata = {k: v for k, v in self.g.ndata.items()}
      self.edata = {k: v for k, v in self.g.edata.items()}
      self.g.ndata.clear()
      self.g.edata.clear()
      self.print_fn("Save ndata and edata in class.")
      self.print_fn("Clear ndata and edata in graph.")
  
      self.sampler = SEALSampler(
          graph=self.g,
          hop=hop,
          num_workers=num_workers,
          print_fn=print_fn,
      )
  
imports: import os.path
  from copy import deepcopy
  import dgl
  import torch
  from dgl import add_self_loop, DGLGraph, NID
  from dgl.dataloading.negative_sampler import Uniform
  from torch.utils.data import DataLoader, Dataset
  from tqdm import tqdm
  from utils import drnl_node_labeling
label_desc: Use image node_id 1 to create a new SEALData object from inherited base classes: object with example: obj = SEALData(g, split_edge, hop, neg_samples, subsample_ratio, prefix, save_dir, num_workers, shuffle, use_coalesce, print_fn)