class_docstr: SGL is a GCN-based recommender model.
  
  SGL supplements the classical supervised task of recommendation with an auxiliary
  self supervised task, which reinforces node representation learning via self-
  discrimination.Specifically,SGL generates multiple views of a node, maximizing the
  agreement between different views of the same node compared to that of other nodes.
  SGL devises three operators to generate the views — node dropout, edge dropout, and
  random walk — that change the graph structure in different manners.
  
  We implement the model following the original author with a pairwise training mode.
code: def calculate_loss(self, interaction):
      if (
          self.restore_user_e is not None
          or self.restore_item_e is not None
      ):
          self.restore_user_e, self.restore_item_e = None, None
  
      user_list = interaction[self.USER_ID]
      pos_item_list = interaction[self.ITEM_ID]
      neg_item_list = interaction[self.NEG_ITEM_ID]
      user_emd, item_emd = self.forward(self.train_graph)
      user_sub1, item_sub1 = self.forward(self.sub_graph1)
      user_sub2, item_sub2 = self.forward(self.sub_graph2)
      total_loss = self.calc_bpr_loss(
          user_emd, item_emd, user_list, pos_item_list, neg_item_list
      ) + self.calc_ssl_loss(
          user_list,
          pos_item_list,
          user_sub1,
          user_sub2,
          item_sub1,
          item_sub2,
      )
      return total_loss
  
imports: import numpy
  import scipy.sparse
  import torch
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.model.init import xavier_uniform_initialization
  from recbole.model.loss import BPRLoss, EmbLoss
  from recbole.utils import InputType
  import torch.nn.functional
label_desc: Use image node_id 7 for calling the SGL obj's underlying member method code with example usage: obj.calculate_loss(interaction) and returns: total_loss