code: def filter_spaces_start_with(
      spaces: Dict, start_with: str
  ) -> gym.spaces.Dict:
      """
      Filters a dict and returns the filtered dict as new gym space
  
      :param spaces: The gym space as dict
      :param start_with: The string the key should start with
      :return: The gym action space
      """
      return gym.spaces.Dict(
          filter_dict_starts_with(spaces, start_with)
      )
  
imports: from typing import Any, Dict, Union, Tuple, Callable, Optional
  import gym
  import numpy
  from maze.core.env.maze_env import MazeEnv
  from maze.core.env.structured_env import StructuredEnv, StepKeyType, ActorID
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.core.wrappers.wrapper import Wrapper
label_desc: Use image node_id 3 for calling a global function with example usage: filter_spaces_start_with(spaces, start_with) and returns: gym