code: def is_valid_filetype(path: Union[Path, Text]) -> bool:
      """Checks if given file has a supported extension.
  
      Args:
          path: Path to the source file.
  
      Returns:
          `True` is given file has supported extension, `False` otherwise.
      """
      return (
          Path(path).is_file()
          and Path(path).suffix in TRAINING_DATA_EXTENSIONS
      )
  
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 8 for calling a global function with example usage: is_valid_filetype(path) and returns: unknown