from pathlib import Path


def filter_extensions(files, extensions):
    """Filter files by extensions."""
    extensions = {f".{ext}" for ext in extensions}
    return [x for x in files if Path(x).suffix in extensions]