code: def __init__(self, g, k, neg_share=False, device=None):
      if device is None:
          device = g.device
      self.weights = g.in_degrees().float().to(device) ** 0.75
      self.k = k
      self.neg_share = neg_share
  
imports: import dgl
  import torch
label_desc: Use image node_id 1 to create a new NegativeSampler object from inherited base classes: object with example: obj = NegativeSampler(g, k, neg_share, device)