code: def test_generic_open_binary(tmp_path, data, filename, mode):
      """Test the bz2 file unzipping context manager using dummy binary data."""
      dummy_data = data
      dummy_filename = os.fspath(tmp_path / filename)
      with open(dummy_filename, "w" + mode) as f:
          f.write(dummy_data)
  
      with hf.generic_open(dummy_filename, "r" + mode) as f:
          read_binary_data = f.read()
  
      assert read_binary_data == dummy_data
  
      dummy_filename = os.fspath(tmp_path / (filename + ".bz2"))
      with hf.bz2.open(dummy_filename, "w" + mode) as f:
          f.write(dummy_data)
  
      with hf.generic_open(dummy_filename, "r" + mode) as f:
          read_binary_data = f.read()
  
      assert read_binary_data == dummy_data
  
imports: import os
  import unittest
  from datetime import datetime
  from unittest import mock
  import dask.array
  import numpy
  import numpy.testing
  import pyresample.geometry
  import pytest
  import xarray
  from fsspec.implementations.memory import MemoryFile, MemoryFileSystem
  from pyproj import CRS
  from satpy.readers import FSFile
  from satpy.readers import utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_generic_open_binary(tmp_path, data, filename, mode) without return types