code: def _to_hashable(obj):
      """Trick to make a dict saveable in a set."""
      if isinstance(obj, dict):
          return frozenset((k, _to_hashable(v)) for k, v in obj.items())
      if isinstance(obj, list):
          return tuple(_to_hashable(v) for v in obj)
      return obj
  
file_path: nni/nni/nas/strategy/utils.py
imports: from __future__ import annotations
  import logging
  from typing import Any, Type, TypeVar, Callable
  from nni.mutable import SampleValidationError
label_desc: Use image node_id 1 for calling a global function with example usage: _to_hashable(obj) and returns: obj, frozenset, tuple