code: def get_weightings(weight_schedule, snrs, sigma_data):
      if weight_schedule == "snr":
          weightings = snrs
      elif weight_schedule == "snr+1":
          weightings = snrs + 1
      elif weight_schedule == "karras":
          weightings = snrs + 1.0 / sigma_data**2
      elif weight_schedule == "truncated-snr":
          weightings = th.clamp(snrs, min=1.0)
      elif weight_schedule == "uniform":
          weightings = th.ones_like(snrs)
      else:
          raise NotImplementedError()
      return weightings
  
imports: import random
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from piq import LPIPS
  from torchvision.transforms import RandomCrop
  from .None import dist_util
  from .nn import mean_flat, append_dims, append_zero
  from .random_util import get_generator
label_desc: Use image node_id 1 for calling a global function with example usage: get_weightings(weight_schedule, snrs, sigma_data) and returns: weightings