[WIP] Add doctests for tutorials
{'login': 'stevhliu', 'id': 59462357, 'node_id': 'MDQ6VXNlcjU5NDYyMzU3', 'avatar_url': 'https://avatars.githubusercontent.com/u/59462357?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/stevhliu', 'html_url': 'https://github.com/stevhliu', 'followers_url': 'https://api.github.com/users/stevhliu/followers', 'following_url': 'https://api.github.com/users/stevhliu/following{/other_user}', 'gists_url': 'https://api.github.com/users/stevhliu/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/stevhliu/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/stevhliu/subscriptions', 'organizations_url': 'https://api.github.com/users/stevhliu/orgs', 'repos_url': 'https://api.github.com/users/stevhliu/repos', 'events_url': 'https://api.github.com/users/stevhliu/events{/privacy}', 'received_events_url': 'https://api.github.com/users/stevhliu/received_events', 'type': 'User', 'site_admin': False}
[]
[]
["I manage to remove the mentions of ellipsis in the code by launching the command as follows:\r\n\r\n```\r\npython -m doctest -v docs/source/load_hub.rst -o=ELLIPSIS\r\n```\r\n\r\nThe way you put your ellipsis will only work on mac, I've adapted it for linux as well with the following:\r\n\r\n```diff\r\n    >>> from datasets import load_dataset_builder\r\n    >>> dataset_builder = load_dataset_builder('imdb')\r\n-   >>> print(dataset_builder.cache_dir) #doctest: +ELLIPSIS\r\n-   /Users/.../.cache/huggingface/datasets/imdb/plain_text/1.0.0/...\r\n+   >>> print(dataset_builder.cache_dir)\r\n+   /.../.cache/huggingface/datasets/imdb/plain_text/1.0.0/...\r\n```\r\n\r\nThis passes on my machine:\r\n\r\n```\r\nTrying:\r\n    print(dataset_builder.cache_dir)\r\nExpecting:\r\n    /.../.cache/huggingface/datasets/imdb/plain_text/1.0.0/...\r\nok\r\n```\r\n\r\nI'm getting a last error:\r\n\r\n```py\r\nExpected:\r\n    DatasetDict({\r\n        train: Dataset({\r\n            features: ['sentence1', 'sentence2', 'label', 'idx'],\r\n            num_rows: 3668\r\n        })\r\n        validation: Dataset({\r\n            features: ['sentence1', 'sentence2', 'label', 'idx'],\r\n            num_rows: 408\r\n        })\r\n        test: Dataset({\r\n            features: ['sentence1', 'sentence2', 'label', 'idx'],\r\n            num_rows: 1725\r\n        })\r\n    })\r\nGot:\r\n    DatasetDict({\r\n        train: Dataset({\r\n            features: ['idx', 'label', 'sentence1', 'sentence2'],\r\n            num_rows: 3668\r\n        })\r\n        validation: Dataset({\r\n            features: ['idx', 'label', 'sentence1', 'sentence2'],\r\n            num_rows: 408\r\n        })\r\n        test: Dataset({\r\n            features: ['idx', 'label', 'sentence1', 'sentence2'],\r\n            num_rows: 1725\r\n        })\r\n    })\r\n```\r\n\r\nBut this is due to `doctest` looking for an exact match and the list having an unordered print order. I wish `doctest` would be a bit more flexible with that."]
{'url': 'https://api.github.com/repos/huggingface/datasets/pulls/3338', 'html_url': 'https://github.com/huggingface/datasets/pull/3338', 'diff_url': 'https://github.com/huggingface/datasets/pull/3338.diff', 'patch_url': 'https://github.com/huggingface/datasets/pull/3338.patch', 'merged_at': None}
Opening a PR as discussed with @LysandreJik for some help with doctest issues. The goal is to add doctests for each of the tutorials in the documentation to make sure the code samples work as shown.

### Issues

A doctest has been added in the docstring of the `load_dataset_builder` function in `load.py` to handle variable outputs with the `ELLIPSIS` directive. When I run doctest on the `load_hub.rst` file, doctest should recognize the expected output from the docstring, and the corresponding code sample in `load_hub.rst` should pass. I am having the same issue with handling tracebacks in the `load_dataset` function.

From the docstring:
```
>>> dataset_builder.cache_dir #doctest: +ELLIPSIS
/Users/.../.cache/huggingface/datasets/imdb/plain_text/1.0.0/...
```
Test result:
```
Failed example:
    dataset_builder.cache_dir
Expected:
    /Users/.../.cache/huggingface/datasets/imdb/plain_text/1.0.0/...
Got:
    /Users/steven/.cache/huggingface/datasets/imdb/plain_text/1.0.0/2fdd8b9bcadd6e7055e742a706876ba43f19faee861df134affd7a3f60fc38a1
```

I am able to get the doctest to pass by adding the doctest directives (`ELLIPSIS` and `NORMALIZE_WHITESPACE`) to the code samples in the `rst` file directly. But my understanding is that these directives should also work in the docstrings of the functions. I am running the test from the root of the directory:

```
python -m doctest -v docs/source/load_hub.rst
```
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3338/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}