def check_file_name_ending(file_name, ending):
    """
    Check if the file_name has the expected file_ending

    If one of the provided endings is the file_name's ending return `True`, else `False`

    Parameters
    ----------
    file_name : str
        The file_name to check the ending for
        The file_name may contain a path, so ``file_name.ending`` as well as ``path/to/file_name.ending`` will work

    ending : str, set, list
        The desired ending or multiple desired endings
        For single entries e.g. ``.json`` or ``csv``, for multiple endings e.g. ``['.json', 'csv']``

    Returns
    -------
    bool
        `True` if the `file_name`'s ending is in the given `ending`, else `False`

    """
    if not isinstance(file_name, str):
        raise TypeError(
            f'file_name needs to be string, {type(file_name)} provided')
    if not isinstance(ending, (str, list, set)):
        raise TypeError(
            f'ending needs to be either a list or a string, {type(ending)} provided'
            )
    if not isinstance(ending, (set, list)):
        ending = [ending]
    for element in ending:
        if element[0] == '.':
            ending[ending.index(element)] = element[1:]
    if file_name.split('.')[-1] in ending:
        return True
    return False
