code: def define_plot(
      create_figure_function: Callable, input_name: str = None
  ) -> Callable:
      """
      Event method decorator, defines a plot.
      :return: The decorator function
      """
  
      def decorator(func_obj):
          """
          :param func_obj: The actual function to be decorated
          :return The unmodified function object (required by the Python decorator semantics)
          """
          render_figure_dict = getattr(
              func_obj, "tensorboard_render_figure_dict", None
          )
  
          # create dict if not existing
          if not render_figure_dict:
              render_figure_dict = dict()
              setattr(
                  func_obj,
                  "tensorboard_render_figure_dict",
                  render_figure_dict,
              )
  
          render_figure_dict[input_name] = create_figure_function
  
          return func_obj
  
      return decorator
  
file_path: maze/maze/core/log_stats/event_decorators.py
imports: import inspect
  from collections import defaultdict
  from typing import Callable, Optional, List, Dict
  from maze.core.log_stats.log_stats import LogStatsLevel
label_desc: Use image node_id 9 for calling a global function with example usage: define_plot(create_figure_function, input_name) and returns: decorator, func_obj