#3337 Add typing overloads to Dataset.__getitem__ for mypy
{'login': 'Dref360', 'id': 8976546, 'node_id': 'MDQ6VXNlcjg5NzY1NDY=', 'avatar_url': 'https://avatars.githubusercontent.com/u/8976546?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/Dref360', 'html_url': 'https://github.com/Dref360', 'followers_url': 'https://api.github.com/users/Dref360/followers', 'following_url': 'https://api.github.com/users/Dref360/following{/other_user}', 'gists_url': 'https://api.github.com/users/Dref360/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/Dref360/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/Dref360/subscriptions', 'organizations_url': 'https://api.github.com/users/Dref360/orgs', 'repos_url': 'https://api.github.com/users/Dref360/repos', 'events_url': 'https://api.github.com/users/Dref360/events{/privacy}', 'received_events_url': 'https://api.github.com/users/Dref360/received_events', 'type': 'User', 'site_admin': False}
[]
[]
Locally the `make quality` passes with the same dependencies. I would suggest upgrading flake8. (I can take care of it in another PR)
cc @lhoestq  Thank you for fixing flake8! I think we are ready to merge then. 
Add typing overloads to Dataset.__getitem__ for mypy

Fixes #3337 

**Iterable**
Iterable from `collections` cannot have a type, so you can't do `Iterable[int]` for example. `typing` has a Generic version that builds upon the one from `collections`.

**Flake8**
I had to add `# noqa: F811`, this is a bug from Flake8.

datasets uses flake8==3.7.9 which released in October 2019 if I update flake8 (4.0.1), I no longer get these errors, but I did not want to make the update without your approval. (It also triggers other errors like no args in f-strings.)
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/3382/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}
{'url': 'https://api.github.com/repos/huggingface/datasets/pulls/3382', 'html_url': 'https://github.com/huggingface/datasets/pull/3382', 'diff_url': 'https://github.com/huggingface/datasets/pull/3382.diff', 'patch_url': 'https://github.com/huggingface/datasets/pull/3382.patch', 'merged_at': '2021-12-14T10:28:54Z'}