code: def test_arrow_writer_with_filesystem(mockfs):
      path = "mock://dataset-train.arrow"
      with ArrowWriter(
          path=path, storage_options=mockfs.storage_options
      ) as writer:
          assert isinstance(writer._fs, type(mockfs))
          assert writer._fs.storage_options == mockfs.storage_options
          writer.write({"col_1": "foo", "col_2": 1})
          writer.write({"col_1": "bar", "col_2": 2})
          num_examples, num_bytes = writer.finalize()
      assert num_examples == 2
      assert num_bytes > 0
      assert mockfs.exists(path)
  
imports: import copy
  import os
  import tempfile
  from unittest import TestCase
  from unittest.mock import patch
  import numpy
  import pyarrow
  import pyarrow.parquet
  import pytest
  from datasets.arrow_writer import ArrowWriter, OptimizedTypedSequence, ParquetWriter, TypedSequence
  from datasets.features import Array2D, ClassLabel, Features, Image, Value
  from datasets.features.features import Array2DExtensionType, cast_to_python_objects
  from datasets.keyhash import DuplicatedKeysError, InvalidKeyError
  from .utils import require_pil
label_desc: Use image node_id 16 for calling a global function with example usage: test_arrow_writer_with_filesystem(mockfs) without return types