code: def is_valid_image(img):
      return (
          isinstance(img, (PIL.Image.Image, np.ndarray))
          or is_torch_tensor(img)
          or is_tf_tensor(img)
          or is_jax_tensor(img)
      )
  
imports: import os
  from typing import TYPE_CHECKING, List, Tuple, Union
  import numpy
  from packaging import version
  import requests
  from .utils import ExplicitEnum, is_jax_tensor, is_tf_tensor, is_torch_available, is_torch_tensor, is_vision_available, to_numpy
  from .utils.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_STANDARD_MEAN, IMAGENET_STANDARD_STD
label_desc: Use image node_id 1 for calling a global function with example usage: is_valid_image(img) and returns: unknown