code: def test_wait_file_available(spark_test_ctx):
      pq_dir = os.path.join(spark_test_ctx.tempdir, "test_ev")
      os.makedirs(pq_dir)
      file1_path = os.path.join(pq_dir, "file1")
      file2_path = os.path.join(pq_dir, "file2")
      url1 = "file://" + file1_path.replace(os.sep, "/")
      url2 = "file://" + file2_path.replace(os.sep, "/")
  
      url_list = [url1, url2]
  
      def create_file(p):
          with open(p, "w"):
              pass
  
      # 1. test all files exists.
      create_file(file1_path)
      create_file(file2_path)
      _wait_file_available(url_list)
  
      # 2. test one file does not exists. Raise error.
      os.remove(file2_path)
      with pytest.raises(
          RuntimeError,
          match="Timeout while waiting for all parquet-store files to appear at urls",
      ):
          _wait_file_available(url_list)
  
      # 3. test one file accessible after 1 second.
      def delay_create_file2():
          time.sleep(1)
          create_file(file2_path)
  
      threading.Thread(target=delay_create_file2()).start()
  
      _wait_file_available(url_list)
  
imports: import os
  import subprocess
  import sys
  import tempfile
  import threading
  import time
  from distutils.version import LooseVersion
  import numpy
  import pyspark
  import pytest
  import py4j
  import tensorflow.compat.v1
  from pyspark.sql.functions import pandas_udf
  from pyspark.sql.types import ArrayType, BinaryType, BooleanType, ByteType, DoubleType, FloatType, IntegerType, LongType, ShortType, StringType, StructField, StructType
  from six.moves.urllib.parse import urlparse
  from petastorm import make_batch_reader
  from petastorm.fs_utils import FilesystemResolver
  from petastorm.spark import SparkDatasetConverter, make_spark_converter, spark_dataset_converter
  from petastorm.spark.spark_dataset_converter import _check_dataset_file_median_size, _check_parent_cache_dir_url, _check_rank_and_size_consistent_with_horovod, _check_url, _get_horovod_rank_and_size, _get_spark_session, _make_sub_dir_url, register_delete_dir_handler, _wait_file_available, _normalize_databricks_dbfs_url
  from unittest import mock
  from petastorm.tests.test_tf_utils import create_tf_graph
label_desc: Use image node_id 26 for calling a global function with example usage: test_wait_file_available(spark_test_ctx) without return types