code: def assert_image_bytes(img_bytes, file_name, _raise=True):
      expected_img_path = os.path.join(images_dir, file_name)
  
      try:
          with open(expected_img_path, "rb") as f:
              expected = f.read()
  
          assert expected == img_bytes
  
      except (OSError, AssertionError) as e:
          failed_path = os.path.join(failed_dir, file_name)
          print(
              'Saving failed image to "{failed_path}"'.format(
                  failed_path=failed_path
              )
          )
  
          if not os.path.exists(failed_dir):
              os.mkdir(failed_dir)
  
          with open(failed_path, "wb") as f:
              f.write(img_bytes)
  
          if _raise:
              raise e
  
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 6 for calling a global function with example usage: assert_image_bytes(img_bytes, file_name, _raise) without return types