code: def test_json_write_block_path_provider(
      ray_start_regular_shared,
      fs,
      data_path,
      endpoint_url,
      mock_block_write_path_provider,
  ):
      if endpoint_url is None:
          storage_options = {}
      else:
          storage_options = dict(
              client_kwargs=dict(endpoint_url=endpoint_url)
          )
  
      # Single block.
      df1 = pd.DataFrame({"one": [1, 2, 3], "two": ["a", "b", "c"]})
      ds = ray.data.from_pandas([df1])
      ds._set_uuid("data")
      ds.write_json(
          data_path,
          filesystem=fs,
          block_path_provider=mock_block_write_path_provider,
      )
      file_path = os.path.join(
          data_path, "000000_000000_data.test.json"
      )
      assert df1.equals(
          pd.read_json(
              file_path,
              orient="records",
              lines=True,
              storage_options=storage_options,
          )
      )
  
      # Two blocks.
      df2 = pd.DataFrame({"one": [4, 5, 6], "two": ["e", "f", "g"]})
      ds = ray.data.from_pandas([df1, df2])
      ds._set_uuid("data")
      ds.write_json(
          data_path,
          filesystem=fs,
          block_path_provider=mock_block_write_path_provider,
      )
      file_path2 = os.path.join(
          data_path, "000001_000000_data.test.json"
      )
      df = pd.concat([df1, df2])
      ds_df = pd.concat(
          [
              pd.read_json(
                  file_path,
                  orient="records",
                  lines=True,
                  storage_options=storage_options,
              ),
              pd.read_json(
                  file_path2,
                  orient="records",
                  lines=True,
                  storage_options=storage_options,
              ),
          ]
      )
      assert df.equals(ds_df)
  
imports: import json
  import os
  import shutil
  from functools import partial
  import pandas
  import pyarrow
  import pyarrow.json
  import pytest
  from pytest_lazyfixture import lazy_fixture
  import ray
  from ray.data.block import BlockAccessor
  from ray.data.datasource import BaseFileMetadataProvider, FastFileMetadataProvider, PartitionStyle, PathPartitionFilter
  from ray.data.datasource.path_util import _unwrap_protocol
  from ray.data.tests.conftest import *
  from ray.data.tests.mock_http_server import *
  from ray.data.tests.test_partitioning import PathPartitionEncoder
  from ray.data.tests.util import Counter
  from ray.tests.conftest import *
label_desc: Use image node_id 11 for calling a global function with example usage: test_json_write_block_path_provider(ray_start_regular_shared, fs, data_path, endpoint_url, mock_block_write_path_provider) without return types