code: def plot_timelines(
      plot_specs: Dict[str, List[Any]],
      event_log_dirs: Dict[str, Path],
      subplot_shape: Tuple[int, int],
  ):
      """Render timeline plots (line plots).
  
      :param plot_specs: Specification of what to plot
      :param event_log_dirs: Where the experiment data are located
      :param subplot_shape: How to layout the subplots
      """
      renderer = EventStatsRenderer()
      for i, (plot_name, spec) in enumerate(plot_specs.items()):
          event_name = spec[0]
          post_processing_func = spec[3]
          if (
              post_processing_func is not None
              and post_processing_func
              not in EventStatsRenderer.POST_PROCESSING_FUNCS
          ):
              # Keep the globals here for now to support the custom smoothing
              post_processing_func = globals()[post_processing_func]
  
          event_log_df = load_data_for_event(event_log_dirs, event_name)
  
          # Render
          plt.subplot(subplot_shape[0], subplot_shape[1], i + 1)
          renderer.render_timeline_stat(
              df=event_log_df,
              event_name=event_name,
              metric_name=spec[1],
              group_by="experiment",
              aggregation_func=spec[2],
              post_processing_func=post_processing_func,
          )
  
          # Override the default labels
          plt.title("")
          plt.title(
              plot_name + " ({})".format(spec[2])
              if spec[2] is not None
              else plot_name,
              fontdict=dict(fontsize=10),
          )
          plt.xlabel("Evaluation day")
          plt.ylabel("")
  
      plt.tight_layout()
      plt.show()
  
file_path: maze/evaluation/rollout_evaluation_plots.py
imports: import argparse
  from pathlib import Path
  from typing import Dict, Tuple, List, Any
  import matplotlib.pyplot
  import pandas
  import seaborn
  import yaml
  from maze.core.rendering.events_stats_renderer import EventStatsRenderer
label_desc: Use image node_id 3 for calling a global function with example usage: plot_timelines(plot_specs, event_log_dirs, subplot_shape) without return types