code: def clear_global_state():
      """Resets the seed and global state to ensure that consecutive tests run under the same preconditions."""
      # ensure that there are no left-overs from previous runs
      LogEventsWriterRegistry.writers = []  # clear writers
      TrajectoryWriterRegistry.writers = []  # clear writers
  
      for writer in GlobalLogState.global_log_stats_writers:
          writer.close()
  
      GlobalLogState.global_step = 1
      GlobalLogState.hook_on_log_step = []
      GlobalLogState.global_log_stats_writers = []
  
imports: import glob
  import os
  import pickle
  import sys
  from typing import Union
  from omegaconf import DictConfig, OmegaConf
  from maze.core.env.base_env import BaseEnv
  from maze.core.log_events.log_events_writer_registry import LogEventsWriterRegistry
  from maze.core.log_stats.log_stats import GlobalLogState
  from maze.core.log_stats.log_stats import register_log_stats_writer
  from maze.core.log_stats.log_stats_env import LogStatsEnv
  from maze.core.log_stats.log_stats_writer_console import LogStatsWriterConsole
  from maze.core.log_stats.log_stats_writer_tensorboard import LogStatsWriterTensorboard
  from maze.core.trajectory_recording.writers.trajectory_writer_registry import TrajectoryWriterRegistry
  from maze.utils.bcolors import BColors
label_desc: Use image node_id 1 for calling a global function with example usage: clear_global_state() without return types