code: def apply_parametrization_norm(module: nn.Module, norm: str = "none"):
      assert norm in CONV_NORMALIZATIONS
      if norm == "weight_norm":
          return weight_norm(module)
      elif norm == "spectral_norm":
          return spectral_norm(module)
      else:
          # We already check was in CONV_NORMALIZATION, so any other choice
          # doesn't need reparametrization.
          return module
  
imports: import math
  import typing
  import warnings
  import torch
  from torch import nn
  from torch.nn import functional
  from torch.nn.utils import spectral_norm, weight_norm
label_desc: Use image node_id 1 for calling a global function with example usage: apply_parametrization_norm(module, norm) and returns: weight_norm, spectral_norm, module