import fnmatch


def fpath_has_ext(fname, exts, case_sensitive=False):
    """returns true if the filename has any of the given extensions"""
    fname_ = fname.lower() if not case_sensitive else fname
    if case_sensitive:
        ext_pats = ['*' + ext for ext in exts]
    else:
        ext_pats = ['*' + ext.lower() for ext in exts]
    return any([fnmatch.fnmatch(fname_, pat) for pat in ext_pats])