def _four_regions_labels(points):
    points = np.asarray(points)
    region = np.zeros(points.shape[0], dtype='uint8')
    tophalf = points[:, 1] > 0
    righthalf = points[:, 0] > 0
    dists = np.sqrt(np.sum(points ** 2, axis=1))

    # The easy ones -- the outer shelf.
    region[dists > np.sqrt(2)] = 255
    outer = dists > 5. / 6.
    region[np.logical_and(tophalf, outer)] = 3
    region[np.logical_and(np.logical_not(tophalf), outer)] = 0

    firstring = np.logical_and(dists > 1. / 6., dists <= 1. / 2.)
    secondring = np.logical_and(dists > 1. / 2., dists <= 5. / 6.)

    # Region 2 -- right inner and left outer, excluding center nut
    region[np.logical_and(firstring, righthalf)] = 2
    region[np.logical_and(secondring, np.logical_not(righthalf))] = 2

    # Region 1 -- left inner and right outer, including center nut
    region[np.logical_and(secondring, righthalf)] = 1
    region[np.logical_and(np.logical_not(righthalf), dists < 1. / 2.)] = 1
    region[np.logical_and(righthalf, dists < 1. / 6.)] = 1
    assert np.all(region >= 0) and np.all(region <= 3)
    return region
The good case should pass.
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/datasets/four_regions.py/_four_regions_labels--crossover with--dataset/ETHPy150Open ntoll/p4p2p/test/dht/test_crypto.py/TestVerifyItem.test_good_item