code: def test_file_extensions(ray_start_regular_shared, tmp_path):
      csv_path = os.path.join(tmp_path, "file.csv")
      with open(csv_path, "w") as file:
          file.write("spam")
  
      txt_path = os.path.join(tmp_path, "file.txt")
      with open(txt_path, "w") as file:
          file.write("ham")
  
      datasource = MockFileBasedDatasource(
          [csv_path, txt_path], file_extensions=None
      )
      ds = ray.data.read_datasource(datasource)
      assert sorted(ds.input_files()) == sorted([csv_path, txt_path])
  
      datasource = MockFileBasedDatasource(
          [csv_path, txt_path], file_extensions=["csv"]
      )
      ds = ray.data.read_datasource(datasource)
      assert ds.input_files() == [csv_path]
  
file_path: ray/python/ray/data/tests/test_file_based_datasource.py
imports: import os
  from typing import Iterator
  from unittest import mock
  import pyarrow
  import pytest
  import ray
  from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
  from ray.data.block import Block
  from ray.data.datasource.file_based_datasource import OPEN_FILE_MAX_ATTEMPTS, FileBasedDatasource, _open_file_with_retry
  from ray.data.datasource.path_util import _is_local_windows_path
label_desc: Use image node_id 4 for calling a global function with example usage: test_file_extensions(ray_start_regular_shared, tmp_path) without return types