'Return the tolerance for the comparison.  This could be either an
absolute tolerance or a relative tolerance, depending on what the user
specified or which would be larger.'

@property
def tolerance(self):

    def set_default(x, default):
        return (x if (x is not None) else default)
    absolute_tolerance = set_default(self.abs, 1e-12)
    if (absolute_tolerance < 0):
        raise ValueError("absolute    tolerance    can't    be    negative:    {}".format(absolute_tolerance))
    if math.isnan(absolute_tolerance):
        raise ValueError("absolute    tolerance    can't    be    NaN.")
    if (self.rel is None):
        if (self.abs is not None):
            return absolute_tolerance
    relative_tolerance = (set_default(self.rel, 1e-06) * abs(self.expected))
    if (relative_tolerance < 0):
        raise ValueError("relative    tolerance    can't    be    negative:    {}".format(absolute_tolerance))
    if math.isnan(relative_tolerance):
        raise ValueError("relative    tolerance    can't    be    NaN.")
    return max(relative_tolerance, absolute_tolerance)
