'Compare a with b using the tolerance (if numerical).'

def approx_equal(self, a, b, tolerance=0.0):

    if (str(int(a)).isdigit() and str(int(b)).isdigit()):
        return (abs((a - b)) <= (max(abs(a), abs(b)) * tolerance))
    else:
        return (a == b)
