def allowed_file(filename, extensions):
    """Helper function to check if a file is the correct file extension

        Args:
            filename (string): filename as a string
            extensions (list): The list of accepted file extensions

        Returns:
            bool: True if filename is accepted
        """
    return '.' in filename and \
           filename.rsplit('.', 1)[1].lower() in extensions