def is_close_to(self, other, tolerance):
        if type(self.val) is complex or type(other) is complex or type(tolerance) is complex:
            raise TypeError('ordering is not defined for complex numbers')
        if isinstance(self.val, numbers.Number) is False and type(self.val) is not datetime.datetime:
            raise TypeError('val is not numeric or datetime')
        if type(self.val) is datetime.datetime:
            if type(other) is not datetime.datetime:
                raise TypeError('given arg must be datetime, but was <%s>' % type(other).__name__)
            if type(tolerance) is not datetime.timedelta:
                raise TypeError('given tolerance arg must be timedelta, but was <%s>' % type(tolerance).__name__)
        else:
            if isinstance(other, numbers.Number) is False:
                raise TypeError('given arg must be numeric')
            if isinstance(tolerance, numbers.Number) is False:
                raise TypeError('given tolerance arg must be numeric')
            if tolerance < 0:
                raise ValueError('given tolerance arg must be positive')
        if self.val < (other-tolerance) or self.val > (other+tolerance):
            if type(self.val) is datetime.datetime:
                tolerance_seconds = tolerance.days * 86400 + tolerance.seconds + tolerance.microseconds / 1000000
                h, rem = divmod(tolerance_seconds, 3600)
                m, s = divmod(rem, 60)
                self._err('Expected <%s> to be close to <%s> within tolerance <%d:%02d:%02d>, but was not.' % (self.val.strftime('%Y-%m-%d %H:%M:%S'), other.strftime('%Y-%m-%d %H:%M:%S'), h, m, s))
            else:
                self._err('Expected <%s> to be close to <%s> within tolerance <%s>, but was not.' % (self.val, other, tolerance))
        return self

### string assertions ###
Map a logging level name to a key in the priority_names map.
dataset/ETHPy150Open ActivisionGameScience/assertpy/assertpy/assertpy.py/AssertionBuilder.is_close_to--crossover with--dataset/ETHPy150Open babble/babble/include/jython/Lib/logging/handlers.py/SysLogHandler.mapPriority