def is_source(filename: str) -> bool:
    """
    Simple filter function, returns true if the passed filename is considered
    to be a source file (used to build the cache key) for the purpose of caching

    Args:
        filename (str): File path as a string

    Returns:
        bool: Whether the filename is a source file
    """
    file_basename, file_ext = filename_norm_split(filename)
    return (
        (file_basename in source_filenames)
        or (file_ext in source_extensions)
        or any(file_basename.startswith(p) for p in source_filename_prefixes)
    )

    Simple filter function, returns true if the passed filename is considered
    to be a source file (used to build the cache key) for the purpose of caching

    Args:
        filename (str): File path as a string

    Returns:
        bool: Whether the filename is a source file
    
python/aitemplate/backend/build_cache_base.py