code: def alignLoss(emb1, emb2, L1_flag=False):
      if L1_flag:
          distance = torch.sum(torch.abs(emb1 - emb2), 1)
      else:
          distance = torch.sum((emb1 - emb2) ** 2, 1)
      return distance.mean()
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.autograd import Variable
  from recbole.model.abstract_recommender import KnowledgeRecommender
  from recbole.model.init import xavier_uniform_initialization
  from recbole.model.loss import BPRLoss, EmbMarginLoss
  from recbole.utils import InputType
label_desc: Use image node_id 2 for calling a global function with example usage: alignLoss(emb1, emb2, L1_flag) and returns: distance