code: def normalize(
      targets: np.ndarray | Tensor,
      threshold: float | np.ndarray | Tensor,
  ) -> np.ndarray | Tensor:
      """Normalize the targets by using the cumulative density function."""
      if isinstance(targets, Tensor):
          return normalize_torch(targets, threshold)
      if isinstance(targets, np.ndarray):
          return normalize_numpy(targets, threshold)
      raise ValueError(
          f"Targets must be either Tensor or Numpy array. Received {type(targets)}"
      )
  
file_path: anomalib/src/anomalib/post_processing/normalization/cdf.py
imports: from __future__ import annotations
  import numpy
  import torch
  from scipy.stats import norm
  from torch import Tensor
  from torch.distributions import Normal
label_desc: Use image node_id 2 for calling a global function with example usage: normalize(targets, threshold) and returns: normalize_torch, normalize_numpy