code: def compare_float(expected, actual, relTol=None, absTol=None):
      """
      Fail if the floating point values are not close enough, with
      the given message.
  
      You can specify a relative tolerance, absolute tolerance, or both.
  
      """
      if relTol is None and absTol is None:
          raise ValueError(
              "You haven't specified a 'relTol' relative "
              "tolerance or a 'absTol' absolute tolerance "
              "function argument. You must specify one."
          )
      msg = ""
  
      if absTol is not None:
          absDiff = abs(expected - actual)
          if absTol < absDiff:
              template = [
                  "",
                  "Expected: {expected}",
                  "Actual:   {actual}",
                  "Abs diff: {absDiff}",
                  "Abs tol:  {absTol}",
              ]
              msg += "\n  ".join(
                  [line.format(**locals()) for line in template]
              )
  
      if relTol is not None:
          # The relative difference of the two values.  If the expected value is
          # zero, then return the absolute value of the difference.
          relDiff = abs(expected - actual)
          if expected:
              relDiff = relDiff / abs(expected)
  
          if relTol < relDiff:
              # The relative difference is a ratio, so it's always unit-less.
              template = [
                  "",
                  "Expected: {expected}",
                  "Actual:   {actual}",
                  "Rel diff: {relDiff}",
                  "Rel tol:  {relTol}",
              ]
              msg += "\n  ".join(
                  [line.format(**locals()) for line in template]
              )
  
      return msg or None
  
imports: from __future__ import absolute_import, division, print_function
  import six
  import atexit
  import functools
  import hashlib
  import itertools
  import os
  import re
  import shutil
  import sys
  from tempfile import TemporaryFile
  import numpy
  import matplotlib
  from matplotlib.compat import subprocess
  from matplotlib.testing.exceptions import ImageComparisonFailure
  from matplotlib import _png
  from matplotlib import _get_cachedir
  from matplotlib import cbook
label_desc: Use image node_id 2 for calling a global function with example usage: compare_float(expected, actual, relTol, absTol) and returns: unknown