code: def _approx_equal(x, y, eps):
      
      if x.space != y.space:
          return False
  
      if x is y:
          return True
  
      try:
          return x.dist(y) <= eps
      except NotImplementedError:
          try:
              return x == y
          except NotImplementedError:
              return False
docs: Test if elements ``x`` and ``y`` are approximately equal.
  
      ``eps`` is a given absolute tolerance.