def allowed_file(filename, allowed_exts):
    """
    Given a filename, check if its extension is allowed from the list of allowed extensions.
    """

    return '.' in filename and filename.rsplit('.', 1)[1].lower() in allowed_exts