code: def _val2type(value: Any):
      if isinstance(value, list):
          types = set(_val2type(x) for x in value)
          if len(types) == 1:
              return List[types.pop()]  # type: ignore
  
          return List[Union[tuple(types)]]  # type: ignore
  
      if isinstance(value, tuple):
          types = tuple(_val2type(x) for x in value)  # type: ignore
          return Tuple[types]
  
      return type(value)
  
file_path: tvm/python/tvm/tir/schedule/_type_checker.py
imports: import collections
  import collections.abc
  import functools
  import inspect
  from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union
  import typing
label_desc: Use image node_id 6 for calling a global function with example usage: _val2type(value) and returns: type, List, Tuple, List