code: def get_adv_criterion(loss_type: str) -> tp.Callable:
      assert loss_type in ADVERSARIAL_LOSSES
      if loss_type == "mse":
          return mse_loss
      elif loss_type == "hinge":
          return hinge_loss
      elif loss_type == "hinge2":
          return hinge2_loss
      raise ValueError("Unsupported loss")
  
imports: import typing
  import flashy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 for calling a global function with example usage: get_adv_criterion(loss_type) and returns: mse_loss, hinge_loss, hinge2_loss