code: def shot_noise(x: Tensor, severity: int = 1) -> Tensor:
      """Applys shot noise."""
      imagenet_rate_mult = [60, 25, 12, 5, 3]
      cifar_rate_mult = [500, 250, 100, 75, 50]
      rate_mult = interpolate_severity(
          x, cifar_rate_mult, imagenet_rate_mult, severity
      )
      # very likely the clamp is not needed, but numerical stability...
      return (torch.poisson(x * rate_mult) / rate_mult).clamp(
          min=0.0, max=1.0
      )
  
file_path: TorchDrift/torchdrift/data/functional/corruption_functions.py
imports: from torch import Tensor
  import torch
  import math
  import torchdrift.utils
label_desc: Use image node_id 4 for calling a global function with example usage: shot_noise(x, severity) and returns: unknown