from typing import Union
from pathlib import Path


def file_variations(
    filename: Union[str, Path],  # The original filename to use as a base.
    extensions: list,
) -> list:  # list of Paths
    """Create a variation of file names.

    Generate a list of variations on a filename by replacing the extension with
    the provided list.

    Adapted from T. Olsens `file_variations of the pysis module for using pathlib.
    """
    return [Path(filename).with_suffix(extension) for extension in extensions]