code: def is_dir_empty(
      temp_folder,
      append_path=ray._private.ray_constants.DEFAULT_OBJECT_PREFIX,
  ):
      # append_path is used because the file based spilling will append
      # new directory path.
      num_files = 0
      temp_folder = temp_folder / append_path
      if not temp_folder.exists():
          return True
      for path in temp_folder.iterdir():
          num_files += 1
      return num_files == 0
  
imports: import copy
  import json
  import platform
  import random
  import sys
  from datetime import datetime, timedelta
  from unittest.mock import patch
  import numpy
  import pytest
  import ray
  from ray._private.external_storage import create_url_with_offset, parse_url_with_offset, _get_unique_spill_filename, FileSystemStorage, ExternalStorageSmartOpenImpl
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import wait_for_condition
  from ray._raylet import GcsClientOptions
  from ray.tests.conftest import buffer_object_spilling_config, file_system_object_spilling_config, mock_distributed_fs_object_spilling_config
label_desc: Use image node_id 2 for calling a global function with example usage: is_dir_empty(temp_folder, append_path) and returns: unknown, True