docs: 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.
  
      >>> assert_almost_equal(5, 5.00000001)
      >>> assert_almost_equal(5, 5.001)
      Traceback (most recent call last):
          ...
      AssertionError: 5 != 5.001 within 7 places
      >>> assert_almost_equal(5, 5.001, places=2)
      >>> assert_almost_equal(5, 5.001, delta=0.1)
  
      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
              )
          )