def get_file_extension(fn):
    """
    get file extension and check if it is compressed
    :param: str, file path
    :return: str,bool
    """
    # assert isinstance(fn, str)

    compressed_file_ext = ["gz"]
    fn_part = fn.split(".")
    compressed = False
    ext = fn_part[-1]
    if ext in compressed_file_ext:
        compressed = True
        ext = fn_part[-2]
    return ext, compressed