code: def save_plot(fig, file_name=None):
      try:
          from plotly.offline import iplot, init_notebook_mode
  
          init_notebook_mode(connected=True)
          iplot(fig, filename=file_name)
      except Exception:
          from plotly.offline import plot
  
          plot(fig, auto_open=False, filename=file_name)
  
imports: import os
label_desc: Use image node_id 3 for calling a global function with example usage: save_plot(fig, file_name) without return types