code: def plot_timing(
      lengths, timings, lengths_name, timings_name, fig=None
  ):
      if fig is None:
          fig = plt.figure()
  
      plt.scatter(lengths, timings, label=timings_name)
      if PLOT_XLABEL:
          plt.xlabel(
              f"{lengths_name} [tokens]", fontsize=PLOT_LABEL_FONT_SIZE
          )
      if PLOT_YLABEL:
          plt.ylabel(
              f"{timings_name} [sec]", fontsize=PLOT_LABEL_FONT_SIZE
          )
      if PLOT_GRID:
          plt.grid(True)
      if PLOT_TITLE:
          plt.title(f"{timings_name} vs. {lengths_name}")
  
      plt.xticks(fontsize=PLOT_LABEL_FONT_SIZE)
      plt.yticks(fontsize=PLOT_LABEL_FONT_SIZE)
      plt.tight_layout()
  
      return fig
  
imports: import json
  import os
  import sys
  from matplotlib import pyplot
label_desc: Use image node_id 1 for calling a global function with example usage: plot_timing(lengths, timings, lengths_name, timings_name, fig) and returns: fig