def match(self, v2):
        """Assert two values are equivalent.

        NOTE:

            If you don't care (or don't know) a given value, you can specify
            the string DONTCARE as the value. This will cause that item
            to be skipped.

        """

        try:
            error = abs(float(self.v1) - float(v2))
            within_tolerance = error <= self.tolerance
        except (__HOLE__, TypeError):
            # If both values aren't convertible to float, just ignore
            # ValueError if arg is a str, TypeError if it's something else
            # (like None)
            within_tolerance = False

        if hasattr(self.v1, 'keys') and hasattr(v2, 'keys'):
            matcher = DictMatches(self.v1, self.approx_equal, self.tolerance,
                                  self.orderless_lists)
            did_match = matcher.match(v2)
            if did_match is not None:
                return did_match
        elif isinstance(self.v1, list) and isinstance(v2, list):
            matcher = ListMatches(self.v1, self.approx_equal, self.tolerance,
                                  self.orderless_lists)
            did_match = matcher.match(v2)
            if did_match is not None:
                return did_match
        elif 'DONTCARE' in (self.v1, v2):
            return
        elif self.approx_equal and within_tolerance:
            return
        elif self.v1 != v2:
            return ValueMismatch(self.v1, v2)
dataset/ETHPy150Open openstack/ec2-api/ec2api/tests/unit/matchers.py/ValueMatches.match