code: def numpify(x: Union[List, np.ndarray, torch.Tensor]) -> np.ndarray:
      """
      Converts List or torch.Tensor to numpy.ndarray.
      """
      if isinstance(x, np.ndarray):
          return x
      if isinstance(x, List):
          return np.array(x)
      if isinstance(x, torch.Tensor):
          return x.cpu().numpy()  # type: ignore
      raise TypeError(
          "Expected input of type List, np.ndarray, or torch.Tensor."
      )
  
file_path: determined/model_hub/model_hub/utils.py
imports: import logging
  import os
  import typing
  import urllib.parse
  from typing import Any, Dict, List, Union
  import filelock
  import numpy
  import requests
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: numpify(x) and returns: x, np, x