def _has_extension(filename, extensions):
    """
    Checks if the given filename has one of the given extensions
    """
    for ext in extensions:
        if filename.endswith('.' + ext):
            return True
    return False
