code: def get_data_files(
      paths: Optional[Union[Text, List[Text]]],
      filter_predicate: Callable[[Text], bool],
  ) -> List[Text]:
      """Recursively collects all training files from a list of paths.
  
      Args:
          paths: List of paths to training files or folders containing them.
          filter_predicate: property to use when filtering the paths, e.g. `is_nlu_file`.
  
      Returns:
          Paths of training data files.
      """
      data_files = set()
  
      if paths is None:
          paths = []
      elif isinstance(paths, str):
          paths = [paths]
  
      for path in set(paths):
          if not path:
              continue
  
          if is_valid_filetype(path):
              if filter_predicate(path):
                  data_files.add(os.path.abspath(path))
          else:
              new_data_files = _find_data_files_in_directory(
                  path, filter_predicate
              )
              data_files.update(new_data_files)
  
      return sorted(data_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 6 for calling a global function with example usage: get_data_files(paths, filter_predicate) and returns: sorted