code: def make_hashable(obj: Any) -> Tuple:
      """
      Converts object (also nested dicts) into tuples to make them hashable.
      Source: https://stackoverflow.com/a/42151923.
      :param obj: Object to make hashable (e.g. nested dictionary).
      :return: Object as hashable tuple.
      """
  
      if isinstance(obj, (tuple, list)):
          return tuple((make_hashable(e) for e in obj))
  
      if isinstance(obj, dict):
          return tuple(
              sorted((k, make_hashable(v)) for k, v in obj.items())
          )
  
      if isinstance(obj, (set, frozenset)):
          return tuple(sorted(make_hashable(e) for e in obj))
  
      if isinstance(obj, np.ndarray):
          return make_hashable(obj.tolist())
  
      return obj
  
file_path: maze/maze/test/shared_test_utils/reproducibility.py
imports: import base64
  import hashlib
  from typing import Any, Tuple, Callable, List, Optional
  import numpy
  from maze.core.agent.policy import Policy
  from maze.core.env.maze_env import MazeEnv
  from maze.core.env.observation_conversion import ObservationType
label_desc: Use image node_id 2 for calling a global function with example usage: make_hashable(obj) and returns: obj, tuple, tuple, tuple, make_hashable