from typing import Union
import pathlib


def supplement_file_name(file: Union[str, pathlib.Path], sup: str) -> pathlib.Path:
    """
    Adds a string between the file name in a path and the suffix.

    **Parameters**

    - `file` : str

        File name

    - `sup` : str

        String to be added

    **Returns**

    - `out`: pathlib.Path

        "Supplemented" file

    """

    file = pathlib.Path(file)

    # the `suffix` is incorporated into the file name
    return file.with_name(file.stem + f'_{sup}' + file.suffix)