code: def _is_immutable_type(type_: Type, val: Any) -> bool:
      if val is None:
          return True
  
      PRIMITIVE_TYPES = (int, float, bool, str, bytes, tuple)
      # sometimes type can be too relaxed (e.g. Any), so we also check values
      if isinstance(val, PRIMITIVE_TYPES):
          return True
  
      return type_ in PRIMITIVE_TYPES or (
          inspect.isclass(type_) and issubclass(type_, Enum)
      )
  
imports: import dataclasses
  import inspect
  import itertools
  import sys
  import warnings
  from collections import Counter, defaultdict
  from enum import Enum
  from functools import partial
  from typing import Any, Callable, Dict, get_args, get_origin, List, Optional, Tuple, Type, TypeVar, Union
  from omegaconf import DictConfig, OmegaConf, open_dict
label_desc: Use image node_id 10 for calling a global function with example usage: _is_immutable_type(type_, val) and returns: unknown, True, True