code: def test_dataset_to_json_compression(
      self,
      shared_datadir,
      tmp_path_factory,
      extension,
      compression,
      dataset,
  ):
      path = tmp_path_factory.mktemp("data") / f"test.json.{extension}"
      original_path = str(
          shared_datadir / f"test_file.json.{extension}"
      )
      JsonDatasetWriter(dataset, path, compression=compression).write()
  
      with fsspec.open(path, "rb", compression="infer") as f:
          exported_content = f.read()
      with fsspec.open(original_path, "rb", compression="infer") as f:
          original_content = f.read()
      assert exported_content == original_content
  
imports: import io
  import json
  import fsspec
  import pytest
  from datasets import Dataset, DatasetDict, Features, NamedSplit, Value
  from datasets.io.json import JsonDatasetReader, JsonDatasetWriter
  from ..utils import assert_arrow_memory_doesnt_increase, assert_arrow_memory_increases
label_desc: Use image node_id 6 for calling the TestJsonDatasetWriter obj's underlying member method code with example usage: obj.test_dataset_to_json_compression(shared_datadir, tmp_path_factory, extension, compression, dataset) without return types