Fix Code quality issues
This pull request fixes some of the code quality issues raised by DeepSource on my fork of this repository.
I have already fixed some issues using DeepSource's Autofix.

Take a quick look at all the issues caught by DeepSource for this repository [here](https://deepsource.io/gh/withshubh/transformers/issues/?category=recommended).

### Summary of fixes

- Remove unnecessary use of comprehension
- Remove unused imports
- Use literal syntax instead of function calls to create data structure
- Remove unnecessary generator
- Remove unnecessary `return` statement

You can also have a look at the [configuration file](https://github.com/withshubh/transformers/blob/deepsource/.deepsource.toml) I used for DeepSource Analysis.

### Using DeepSource to continuously analyze your repository

- Merge this PR. I have included a `.deepsource.toml` in this PR, which you can use to configure your analysis settings.
- Install DeepSource on your repository [here](https://deepsource.io/signup).
- Activate analysis [here](https://deepsource.io/gh/huggingface/transformers/).

Feel free to merge this PR if you wish to fix the issues.✨
Hello! Rather than fixing code issues, this looks like an opinionated take on the code structure. We like using list/dict comprehensions as we find them explicit, what doesn't `DeepSource` like about these?

We already have code quality setup, with `black`, `isort`, `flake8` and our own tools for code maintainability. I think this is enough already, and don't see the advantage of adding another code quality tool.

Why should we add DeepSource to our code quality stack?<|||||>Hi @LysandreJik :wave: 

> Hello! Rather than fixing code issues, this looks like an opinionated take on the code structure. We like using list/dict comprehensions as we find them explicit, what doesn't `DeepSource` like about these?

DeepSource suggests these because using the other can give a minor performance boost:
Example:
```
In [3]: timeit.timeit(stmt="{num: square for num, square in zip(first_hundred_nums, first_hundred_squares)}", globals=globals())                                                                           
Out[3]: 5.606797965000624

In [4]: timeit.timeit(stmt="dict(zip(first_hundred_nums, first_hundred_squares))", globals=globals())                                                                                                      
Out[4]: 4.588974316000531
```
Also, the inbuilt functions `all()` and `any()` in python also support short-circuiting (evaluation stops as soon as the overall return value of the function is known), but this behavior is lost if you use comprehension.

> We already have code quality setup, with `black`, `isort`, `flake8` and our own tools for code maintainability. I think this is enough already, and don't see the advantage of adding another code quality tool.
> Why should we add DeepSource to our code quality stack?

- DeepSource internally runs black/isort/flake8 checks too. In addition to that: if your codebase is strictly following the conventions from these tools, instead of failing the checks and depending on the contributors to fix it, DeepSource Transformers can do this for you (commit to the same PR with the fixes). Also, you won't need to look after the version upgrades for these tools.
- Fix the issues. DeepSource can automatically fix some of the issues it detects (also includes some flake8 issues) with just a click. Read more about this [here](https://deepsource.io/blog/code-formatting-on-autopilot/).
- DeepSource's own code quality checks.
- Option to analyze only modified code: DeepSource will show you only newly introduced code quality issues for a changeset. Read more about it [here](https://deepsource.io/blog/release-granular-diffs/).<|||||>Hi @LysandreJik :wave: 

Please have a look :eyes:  <|||||>Hey! @LysandreJik @mfuntowicz :wave: 

Please have a look at this! :eyes: <|||||>I vote to stay with our current tooling for now.

We'll follow your work at DeepSource and could reconsider it in a few month, ie. the summer but no need to ping us more for now.

Thanks.