code: def _get(cls: Type[T], value: TKEnum[T]) -> T:
      if isinstance(value, str):
          return cls[value.upper()]
  
      elif isinstance(value, int):
          return cls(value)
  
      elif isinstance(value, cls):
          return value
  
      raise TypeError(
          f"The `.get` method from `{cls}` expects a value with type `str`, `int` or `{cls}`. Gotcha {type(value)}"
      )
  
imports: from enum import Enum, EnumMeta
  from typing import Iterator, Type, TypeVar, Union
  import torch
  from kornia.core import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: _get(cls, value) and returns: cls, cls, value