from pathlib import Path


def indentify_file_format(path_1, path_2) -> str:
    """If filepaths are passed, return a suffix string indicating if
    it is Excel or CSV files. If it neither or if the formats differ
    for the two files, raise an exception.
    """
    suffix_1 = Path(path_1).suffix
    suffix_2 = Path(path_2).suffix
    if suffix_1 != suffix_2:
        raise AssertionError("File format mismatch. Same file types expected.")
    if suffix_1 not in [".xlsx", ".csv"]:
        raise TypeError("Invalid file types. Only .CSV or .XLSX files allowed.")
    return suffix_1