code: def contrastive_parameter_surgery(model, cfg, epoch_exact, cur_iter):
      # cancel some gradients in first epoch of SwAV
      if (
          cfg.MODEL.MODEL_NAME == "ContrastiveModel"
          and cfg.CONTRASTIVE.TYPE == "swav"
          and epoch_exact <= 1.0
      ):
          for name, p in model.named_parameters():
              if "swav_prototypes" in name:
                  p.grad = None
  
      iters_noupdate = 0
      if (
          cfg.MODEL.MODEL_NAME == "ContrastiveModel"
          and cfg.CONTRASTIVE.TYPE == "moco"
      ):
          assert (
              cfg.CONTRASTIVE.QUEUE_LEN
              % (cfg.TRAIN.BATCH_SIZE * cfg.NUM_SHARDS)
              == 0
          )
          iters_noupdate = (
              cfg.CONTRASTIVE.QUEUE_LEN
              // cfg.TRAIN.BATCH_SIZE
              // cfg.NUM_SHARDS
          )
  
      if (
          cur_iter < iters_noupdate and epoch_exact < 1
      ):  #  for e.g. MoCo
          logger.info(
              "Not updating parameters {}/{}".format(
                  cur_iter, iters_noupdate
              )
          )
          update_param = False
      else:
          update_param = True
  
      return model, update_param
  
imports: import math
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import slowfast.models.losses
  import slowfast.utils.distributed
  import slowfast.utils.logging
  from slowfast.models.video_model_builder import X3D, MViT, ResNet, SlowFast
  from .build import MODEL_REGISTRY
label_desc: Use image node_id 2 for calling a global function with example usage: contrastive_parameter_surgery(model, cfg, epoch_exact, cur_iter) and returns: model,  update_param