def _almost_equal(a, b):
    """Check if the two numbers are almost equal
    """
    # arbitrary small number!!!
    threshold = 1e-9
    diff = np.abs(a - b)
    return (diff < threshold)
Check if the two numbers are almost equal