f57c6162ea1dd0d9958d647a67e717f1de9caace,petastorm/tests/test_end_to_end.py,,test_partition_multi_node,#Any#Any#,208

Before Change


    Tests that the reader only returns half of the expected data consistently
    with reader_factory(synthetic_dataset.url, cur_shard=0, shard_count=5) as reader:
        with reader_factory(synthetic_dataset.url, cur_shard=0, shard_count=5) as reader_2:
            results_1 = []
            expected = []
            for row in reader:
                actual = dict(row._asdict())
                results_1.append(actual)
                expected.append(next(d for d in synthetic_dataset.data if d["id"] == actual["id"]))

            assert results_1, "Shard 0 is expected to have at least one row"

            results_2 = [dict(row._asdict()) for row in reader_2]

            assert results_2, "Shard 0 is expected to have at least one row"

            // Since order is non deterministic, we need to sort results by id
            results_1.sort(key=lambda x: x["id"])
            results_2.sort(key=lambda x: x["id"])
            expected.sort(key=lambda x: x["id"])

            np.testing.assert_equal(expected, results_1)
            np.testing.assert_equal(results_1, results_2)

            assert len(results_1) < len(synthetic_dataset.data)

            // Test that separate partitions also have no overlap by checking ids
            id_set = set([item["id"] for item in results_1])
            for partition in range(1, 5):
                with reader_factory(synthetic_dataset.url, cur_shard=partition,
                                    shard_count=5) as reader_other:

After Change


    Tests that the reader only returns half of the expected data consistently
    with reader_factory(synthetic_dataset.url, cur_shard=0, shard_count=5) as reader:
        with reader_factory(synthetic_dataset.url, cur_shard=0, shard_count=5) as reader_2:
            results_1 = set(_readout_all_ids(reader))
            results_2 = set(_readout_all_ids(reader_2))

            assert results_1, "Non empty shard expected"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: uber/petastorm
Commit Name: f57c6162ea1dd0d9958d647a67e717f1de9caace
Time: 2018-12-09
Author: yevgeni@uber.com
File Name: petastorm/tests/test_end_to_end.py
Class Name:
Method Name: test_partition_multi_node


Project Name: snipsco/snips-nlu
Commit Name: 24ea2b5f7bfe4558663614c5bdce3d1f4ebd9567
Time: 2017-09-20
Author: adrien.ball@snips.net
File Name: snips_nlu/slot_filler/feature_functions.py
Class Name:
Method Name: get_token_is_in_fn


Project Name: codelucas/newspaper
Commit Name: 6327d66fc29e242a8a47018d333c12b4b4bcfaf9
Time: 2017-10-21
Author: obulat@gmail.com
File Name: newspaper/nlp.py
Class Name:
Method Name: