def apply(self, dataset, can_fit=False):
        start = self.start
        stop = self.stop
        rng = make_np_rng(self.seed, which_method="randint")
        X = dataset.X
        y = dataset.y

        if y is not None:
            assert X.shape[0] == y.shape[0]

        for i in xrange(X.shape[0]):
            j = rng.randint(X.shape[0])
            tmp = X[i, :].copy()
            X[i, :] = X[j, :].copy()
            X[j, :] = tmp

            if y is not None:
                tmp = y[i, :].copy()
                y[i, :] = y[j, :].copy()
                y[j, :] = tmp
        assert start >= 0
        assert stop > start
        assert stop <= X.shape[0]

        dataset.X = X[start:stop, :]
        if y is not None:
            dataset.y = y[start:stop, :]
send post requests to es restful api
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/datasets/preprocessing.py/ShuffleAndSplit.apply--crossover with--dataset/ETHPy150Open zhongbiaodev/py-mysql-elasticsearch-sync/es_sync/__init__.py/ElasticSync._post_to_es