code: def visualize_log(filename, figsize=None, output=None):
      with open(filename, "r") as f:
          data = json.load(f)
      if "episode" not in data:
          raise ValueError(
              'Log file "{}" does not contain the "episode" key.'.format(
                  filename
              )
          )
      episodes = data["episode"]
  
      # Get value keys. The x axis is shared and is the number of episodes.
      keys = sorted(list(set(data.keys()).difference(set(["episode"]))))
  
      if figsize is None:
          figsize = (15.0, 5.0 * len(keys))
      f, axarr = plt.subplots(len(keys), sharex=True, figsize=figsize)
      for idx, key in enumerate(keys):
          axarr[idx].plot(episodes, data[key])
          axarr[idx].set_ylabel(key)
      plt.xlabel("episodes")
      plt.tight_layout()
      if output is None:
          plt.show()
      else:
          plt.savefig(output)
  
label_desc: Use image node_id 1 for calling a global function with example usage: visualize_log(filename, figsize, output) without return types