code: def read_config(path: Union[Path, str]) -> dict:
      """
      Read YAML file into a dict
  
      :param path: Path of the file to read
      :return: Dict with the YAML file contents
      """
      with open(str(path), "r") as in_config:
          config = yaml.safe_load(in_config)
      return config
  
imports: import os
  from pathlib import Path
  from typing import Mapping, Union, Sequence
  import hydra
  import yaml
  from hydra import initialize_config_module, compose
  from hydra.core.hydra_config import HydraConfig
  from omegaconf import DictConfig
  from maze.core.agent.serialized_torch_policy import SerializedTorchPolicy
  from maze.core.env.maze_env import MazeEnv
  from maze.core.utils.factory import Factory, ConfigType, CollectionOfConfigType
  from maze.core.wrappers.wrapper_factory import WrapperFactory
label_desc: Use image node_id 1 for calling a global function with example usage: read_config(path) and returns: config