Make all dataset downloads deterministic by applying `sorted` to glob and os.listdir
MEMBER
That's great!

I think it would be nice to test "deterministic-ness" of datasets in CI if we can do it (should be left for future PR of course)

Here is a possibility (maybe there are other ways to do it): given that we may soon have efficient and large-scale hashing (cf our discussion on versioning/tracability), we could incorporate a hash of the final Arrow Dataset to the `dataset.json` file and have a test on it as well as CI on a diversity of platform to test the hash (Win/Mac/Linux + various python/env).
What do you think @lhoestq @patrickvonplaten?
2020-06-06T19:48:02Z
https://github.com/huggingface/datasets/pull/247#issuecomment-640109482
https://api.github.com/repos/huggingface/datasets/issues/247
MDEyOklzc3VlQ29tbWVudDY0MDEwOTQ4Mg==
https://api.github.com/repos/huggingface/datasets/issues/comments/640109482/reactions
2020-06-06T19:48:31Z
https://api.github.com/repos/huggingface/datasets/issues/comments/640109482
https://avatars.githubusercontent.com/u/7353373?v=4
https://api.github.com/users/thomwolf/events{/privacy}
https://api.github.com/users/thomwolf/followers
https://api.github.com/users/thomwolf/following{/other_user}
https://api.github.com/users/thomwolf/gists{/gist_id}
https://github.com/thomwolf
thomwolf
MDQ6VXNlcjczNTMzNzM=
https://api.github.com/users/thomwolf/orgs
https://api.github.com/users/thomwolf/received_events
https://api.github.com/users/thomwolf/repos
https://api.github.com/users/thomwolf/starred{/owner}{/repo}
https://api.github.com/users/thomwolf/subscriptions
User
https://api.github.com/users/thomwolf
public
CONTRIBUTOR
> That's great!
> 
> I think it would be nice to test "deterministic-ness" of datasets in CI if we can do it (should be left for future PR of course)
> 
> Here is a possibility (maybe there are other ways to do it): given that we may soon have efficient and large-scale hashing (cf our discussion on versioning/tracability), we could incorporate a hash of the final Arrow Dataset to the `dataset.json` file and have a test on it as well as CI on a diversity of platform to test the hash (Win/Mac/Linux + various python/env).
> What do you think @lhoestq @patrickvonplaten?

I think that's a great idea! The test should be a `RUN_SLOW` test, since it takes a considerable amount of time to download the dataset and generate the examples, but I think we should add some kind of hash test for each dataset.
2020-06-07T11:22:44Z
https://github.com/huggingface/datasets/pull/247#issuecomment-640201792
https://api.github.com/repos/huggingface/datasets/issues/247
MDEyOklzc3VlQ29tbWVudDY0MDIwMTc5Mg==
https://api.github.com/repos/huggingface/datasets/issues/comments/640201792/reactions
2020-06-07T11:22:44Z
https://api.github.com/repos/huggingface/datasets/issues/comments/640201792
https://avatars.githubusercontent.com/u/23423619?v=4
https://api.github.com/users/patrickvonplaten/events{/privacy}
https://api.github.com/users/patrickvonplaten/followers
https://api.github.com/users/patrickvonplaten/following{/other_user}
https://api.github.com/users/patrickvonplaten/gists{/gist_id}
https://github.com/patrickvonplaten
patrickvonplaten
MDQ6VXNlcjIzNDIzNjE5
https://api.github.com/users/patrickvonplaten/orgs
https://api.github.com/users/patrickvonplaten/received_events
https://api.github.com/users/patrickvonplaten/repos
https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}
https://api.github.com/users/patrickvonplaten/subscriptions
User
https://api.github.com/users/patrickvonplaten
public
CONTRIBUTOR
Really nice!!
2020-06-08T05:57:57Z
https://github.com/huggingface/datasets/pull/247#issuecomment-640386780
https://api.github.com/repos/huggingface/datasets/issues/247
MDEyOklzc3VlQ29tbWVudDY0MDM4Njc4MA==
https://api.github.com/repos/huggingface/datasets/issues/comments/640386780/reactions
2020-06-08T05:57:57Z
https://api.github.com/repos/huggingface/datasets/issues/comments/640386780
https://avatars.githubusercontent.com/u/959590?v=4
https://api.github.com/users/jplu/events{/privacy}
https://api.github.com/users/jplu/followers
https://api.github.com/users/jplu/following{/other_user}
https://api.github.com/users/jplu/gists{/gist_id}
https://github.com/jplu
jplu
MDQ6VXNlcjk1OTU5MA==
https://api.github.com/users/jplu/orgs
https://api.github.com/users/jplu/received_events
https://api.github.com/users/jplu/repos
https://api.github.com/users/jplu/starred{/owner}{/repo}
https://api.github.com/users/jplu/subscriptions
User
https://api.github.com/users/jplu
public
This PR makes all datasets loading deterministic by applying `sorted()` to all `glob.glob` and `os.listdir` statements.

Are there other "non-deterministic" functions apart from `glob.glob()` and `os.listdir()` that you can think of @thomwolf @lhoestq @mariamabarham @jplu ?

**Important** 
It does break backward compatibility for these datasets because
1. When loading the complete dataset the order in which the examples are saved is different now
2. When loading only part of a split, the examples themselves might be different.

@patrickvonplaten - the nlp / longformer notebook has to be updated since the examples might now be different