def has_extension(fp, ext, pos=-1, raise_exception=False, **kwargs):
    """
    Test presence of extension in a file path
    * ext
        Single extension name or list of extension names  without dot. Example ["gz, "fa"]
    * pos
        Postition of the extension in the file path. -1 for the last, -2 for the penultimate and so on [DEFAULT -1 = Last position]
    """
    if type(ext) == str:
        ext = [ext]
    if not fp.split('.')[pos].lower() in ext:
        if raise_exception:
            raise ValueError(
                'Invalid extension for file {}. Valid extensions: {}'.
                format(fp, '/'.join(ext)))
        else:
            return False
    else:
        return True
