code: def _get_reduction_op(reduction: str) -> Callable[[Tensor], Tensor]:
      if reduction == "mean":
          return torch.mean
      elif reduction == "sum":
          return torch.sum
      elif reduction == "none":
          return lambda x: x
      else:
          raise ValueError(f"Unknown reduction type: '{reduction}'")
  
file_path: NeuralCompression/neuralcompression/functional/_multiscale_structural_similarity.py
imports: from typing import Callable, Optional, Sequence
  import torch
  from torch import Tensor
  from torch.nn import functional
label_desc: Use image node_id 2 for calling a global function with example usage: _get_reduction_op(reduction) and returns: torch, torch, function