code: def gcs_buffer():
      """Emulate GCS using a binary buffer."""
      pytest.importorskip("gcsfs")
      fsspec = pytest.importorskip("fsspec")
  
      gcs_buffer = BytesIO()
      gcs_buffer.close = lambda: True
  
      class MockGCSFileSystem(fsspec.AbstractFileSystem):
          @staticmethod
          def open(*args, **kwargs):
              gcs_buffer.seek(0)
              return gcs_buffer
  
          def ls(self, path, **kwargs):
              # needed for pyarrow
              return [{"name": path, "type": "file"}]
  
      # Overwrites the default implementation from gcsfs to our mock class
      fsspec.register_implementation(
          "gs", MockGCSFileSystem, clobber=True
      )
  
      return gcs_buffer
  
file_path: pandas/pandas/tests/io/test_gcs.py
imports: from io import BytesIO
  import os
  import pathlib
  import tarfile
  import zipfile
  import numpy
  import pytest
  from pandas import DataFrame, Index, date_range, read_csv, read_excel, read_json, read_parquet
  import pandas._testing
  from pandas.util import _test_decorators
label_desc: Use image node_id 1 for calling a global function with example usage: gcs_buffer() and returns: gcs_buffer, gcs_buffer, list