code: def test_write_creates_dir(tmp_path, ray_start_regular_shared):
      ds = ray.data.range(1)
      path = os.path.join(tmp_path, "test")
  
      ds.write_datasource(
          MockFileDatasink(path=path, try_create_dir=True)
      )
  
      assert os.path.isdir(path)
  
imports: import os
  from typing import Any, Dict
  import pyarrow
  import pytest
  from pyarrow.fs import LocalFileSystem
  import ray
  from ray.data.block import BlockAccessor
  from ray.data.datasource import BlockBasedFileDatasink, RowBasedFileDatasink
label_desc: Use image node_id 6 for calling a global function with example usage: test_write_creates_dir(tmp_path, ray_start_regular_shared) without return types