code: def fix_gym_syspath() -> None:
      """
      Imports gym via sys.path. Workaround for gym import not working in notebooks with certain setups.
      """
  
      try:
          # Try to import gym to see if messing with sys.path is necessary.
          import gym
      except ModuleNotFoundError:
          try:
              # Get info on gym installation path.
              pip_show_output = str(
                  subprocess.check_output(["pip", "show", "gym"])
              )
              # Extract gym path and append to sys.path.
              sys.path.append(
                  pip_show_output.split("\\n")[-4].split(": ")[1]
              )
          # gym is actually not installed.
          except subprocess.CalledProcessError:
              print(
                  "gym is not installed. Please install with: pip install gym."
              )
  
file_path: maze/maze/utils/notebooks.py
imports: import contextlib
  import os
  import subprocess
  import sys
  from maze.core.agent.policy import Policy
  from maze.core.env.maze_env import MazeEnv
  from maze.core.trajectory_recording.utils.monitoring_setup import MonitoringSetup
label_desc: Use image node_id 1 for calling a global function with example usage: fix_gym_syspath() without return types