<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def has_file_extension(filepath, ext_required):
    '''Assert that a filepath has the required file extension

    :param filepath: string filepath presumably containing a file extension
    :param ext_required: the expected file extension
        examples: ".pdf", ".html", ".tex"
    '''
    ext = os.path.splitext(filepath)[-1]
    if ext != ext_required:
        msg_tmpl = "The extension for {}, which is {}, does not equal {}"
        msg_format = msg_tmpl.format(filepath, ext, ext_required)
        raise ValueError(msg_format)
    return True