code: def local_global_loss_(l_enc, g_enc, graph_id):
      num_graphs = g_enc.shape[0]
      num_nodes = l_enc.shape[0]
  
      device = g_enc.device
  
      pos_mask = th.zeros((num_nodes, num_graphs)).to(device)
      neg_mask = th.ones((num_nodes, num_graphs)).to(device)
  
      for nodeidx, graphidx in enumerate(graph_id):
          pos_mask[nodeidx][graphidx] = 1.0
          neg_mask[nodeidx][graphidx] = 0.0
  
      res = th.mm(l_enc, g_enc.t())
  
      E_pos = get_positive_expectation(
          res * pos_mask, average=False
      ).sum()
      E_pos = E_pos / num_nodes
      E_neg = get_negative_expectation(
          res * neg_mask, average=False
      ).sum()
      E_neg = E_neg / (num_nodes * (num_graphs - 1))
  
      return E_neg - E_pos
  
file_path: dgl/examples/pytorch/mvgrl/graph/utils.py
imports: import math
  import numpy
  import torch
  import torch.nn.functional
  from sklearn.metrics import accuracy_score
  from sklearn.model_selection import GridSearchCV, StratifiedKFold
  from sklearn.svm import LinearSVC
label_desc: Use image node_id 4 for calling a global function with example usage: local_global_loss_(l_enc, g_enc, graph_id) and returns: unknown