code: def _find_data_files_in_directory(
      directory: Text, filter_property: Callable[[Text], bool]
  ) -> Set[Text]:
      filtered_files = set()
  
      for root, _, files in os.walk(directory, followlinks=True):
          # we sort the files here to ensure consistent order for repeatable training
          # results
          for f in sorted(files):
              full_path = os.path.join(root, f)
  
              if not is_valid_filetype(full_path):
                  continue
  
              if filter_property(full_path):
                  filtered_files.add(full_path)
  
      return filtered_files
  
imports: import os
  import shutil
  import tempfile
  import uuid
  from enum import Enum
  from pathlib import Path
  from typing import Text, Optional, Union, List, Callable, Set, Iterable
label_desc: Use image node_id 7 for calling a global function with example usage: _find_data_files_in_directory(directory, filter_property) and returns: filtered_files