code: def test_write_image_string_format_inference(fig1, format):
      # Build file paths
      file_name = "fig1." + format
      file_path = os.path.join(tmp_dir, file_name)
  
      # Use file extension to infer image type.
      pio.write_image(
          fig1,
          os.path.join(tmp_dir, file_name),
          width=700,
          height=500,
          engine="orca",
      )
  
      with open(file_path, "rb") as f:
          written_bytes = f.read()
  
      with open(os.path.join(images_dir, file_name), "rb") as f:
          expected_bytes = f.read()
  
      assert written_bytes == expected_bytes
  
imports: import plotly
  import plotly.io
  import plotly.graph_objs
  import os
  import shutil
  import pytest
  import sys
  import pandas
  from io import BytesIO
label_desc: Use image node_id 11 for calling a global function with example usage: test_write_image_string_format_inference(fig1, format) without return types