code: def data_files_with_one_split_and_metadata(
      request, tmp_path, image_file
  ):
      data_dir = (
          tmp_path / "imagefolder_data_dir_with_metadata_one_split"
      )
      data_dir.mkdir(parents=True, exist_ok=True)
      subdir = data_dir / "subdir"
      subdir.mkdir(parents=True, exist_ok=True)
  
      image_filename = data_dir / "image_rgb.jpg"
      shutil.copyfile(image_file, image_filename)
      image_filename2 = data_dir / "image_rgb2.jpg"
      shutil.copyfile(image_file, image_filename2)
      image_filename3 = subdir / "image_rgb3.jpg"  # in subdir
      shutil.copyfile(image_file, image_filename3)
  
      image_metadata_filename = data_dir / f"metadata.{request.param}"
      image_metadata = (
          textwrap.dedent(
              """\
          {"file_name": "image_rgb.jpg", "caption": "Nice image"}
          {"file_name": "image_rgb2.jpg", "caption": "Nice second image"}
          {"file_name": "subdir/image_rgb3.jpg", "caption": "Nice third image"}
          """
          )
          if request.param == "jsonl"
          else textwrap.dedent(
              """\
          file_name,caption
          image_rgb.jpg,Nice image
          image_rgb2.jpg,Nice second image
          subdir/image_rgb3.jpg,Nice third image
          """
          )
      )
      with open(image_metadata_filename, "w", encoding="utf-8") as f:
          f.write(image_metadata)
      data_files_with_one_split_and_metadata = (
          DataFilesDict.from_patterns(
              get_data_patterns(str(data_dir)), data_dir.as_posix()
          )
      )
      assert len(data_files_with_one_split_and_metadata) == 1
      assert len(data_files_with_one_split_and_metadata["train"]) == 4
      return data_files_with_one_split_and_metadata
  
imports: import shutil
  import textwrap
  import numpy
  import pytest
  from datasets import ClassLabel, Features, Image, Value
  from datasets.data_files import DataFilesDict, get_data_patterns
  from datasets.download.streaming_download_manager import StreamingDownloadManager
  from datasets.packaged_modules.imagefolder.imagefolder import ImageFolder
  from ..utils import require_pil
label_desc: Use image node_id 6 for calling a global function with example usage: data_files_with_one_split_and_metadata(request, tmp_path, image_file) and returns: data_files_with_one_split_and_metadata