<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def assert_almost_equal( first, second, msg_fmt="{msg}", places=None, delta=None ):
 """Fail if first and second are not equal after rounding. By default, the difference between first and second is rounded to 7 decimal places. This can be configured with the places argument. Alternatively, delta can be used to specify the maximum allowed difference between first and second. If first and second can not be rounded or both places and delta are supplied, a TypeError is raised. Traceback (most recent call last):
 AssertionError: 5 != 5.001 within 7 places The following msg_fmt arguments are supported: * msg - the default error message * first - the first argument * second - the second argument * places - number of places to compare or None * delta - delta or None """


    if delta is not None and places is not None:
        raise TypeError("'places' and 'delta' are mutually exclusive")
    if delta is not None:
        if delta <= 0:
            raise ValueError("delta must be larger than 0")
        diff = abs(second - first)
        success = diff < delta
        detail_msg = "with delta={}".format(delta)
    else:
        if places is None:
            places = 7
        success = not round(second - first, places)
        detail_msg = "within {} places".format(places)
    if not success:
        msg = "{!r} != {!r} {}".format(first, second, detail_msg)
        fail(
            msg_fmt.format(
                msg=msg, first=first, second=second, places=places, delta=delta
            )
        )