update ruff version (#30932)

* update ruff version

* fix research projects

* Empty

* Fix errors

---------

Co-authored-by: Lysandre <lysandre@huggingface.co>
This commit is contained in:
Arthur
2024-05-22 06:40:15 +02:00
committed by GitHub
parent 60bb571e99
commit 673440d073
1172 changed files with 1555 additions and 1861 deletions

View File

@@ -24,7 +24,6 @@ This script will be (mostly) used in the following 2 situations:
This script is **NOT** intended to be run (manually) by community contributors.
"""
import argparse
import glob
import inspect

View File

@@ -753,9 +753,9 @@ def is_copy_consistent(filename: str, overwrite: bool = False, buffer: dict = No
else:
# not in the target --> add it
theoretical_code_blocks[f"_ignored_new_block_{ignored_new_block_index}"] = code
name_mappings_1[
name_mappings_1[f"_ignored_new_block_{ignored_new_block_index}"] = (
f"_ignored_new_block_{ignored_new_block_index}"
] = f"_ignored_new_block_{ignored_new_block_index}"
)
del observed_code_blocks[name]
observed_code_blocks[f"_ignored_new_block_{ignored_new_block_index}"] = code

View File

@@ -31,7 +31,6 @@ python utils/check_doc_toc.py --fix_and_overwrite
```
"""
import argparse
from collections import defaultdict
from typing import List

View File

@@ -32,6 +32,7 @@ python utils/check_docstrings.py --fix_and_overwrite
which is used by `make fix-copies` (note that this fills what it cans, you might have to manually fill information
like argument descriptions).
"""
import argparse
import ast
import enum

View File

@@ -30,6 +30,7 @@ Auto-sort the doctest list if it is not properly sorted (used in `make fix-copie
python utils/check_doctest_list.py --fix_and_overwrite
```
"""
import argparse
import os

View File

@@ -33,6 +33,7 @@ Update the dummy files if needed (used in `make fix-copies`):
python utils/check_dummies.py --fix_and_overwrite
```
"""
import argparse
import os
import re

View File

@@ -30,6 +30,7 @@ python utils/check_repo.py
It has no auto-fix mode.
"""
import inspect
import os
import re

View File

@@ -25,6 +25,7 @@ python utils/check_support_list.py
It has no auto-fix mode.
"""
import os
from glob import glob

View File

@@ -31,6 +31,7 @@ python utils/check_inits.py --fix_and_overwrite
which is used by `make fix-copies`.
"""
import argparse
import collections
import os

View File

@@ -34,6 +34,7 @@ For a check only (as used in `make quality`) run:
python utils/custom_init_isort.py --check_only
```
"""
import argparse
import os
import re

View File

@@ -1,4 +1,4 @@
""" Script for downloading all GLUE data.
"""Script for downloading all GLUE data.
Original source: https://gist.github.com/W4ngatang/60c2bdb54d156a41194446737ce03e2e
Note: for legal reasons, we are unable to host MRPC.

View File

@@ -14,6 +14,7 @@
"""
Script to find a candidate list of models to deprecate based on the number of downloads and the date of the last commit.
"""
import argparse
import glob
import json

View File

@@ -41,6 +41,7 @@ python release.py --post_release
or use `make post-release`.
"""
import argparse
import os
import re

View File

@@ -29,6 +29,7 @@ To only check if the mappings are properly sorted (as used in `make quality`), d
python utils/sort_auto_mappings.py --check_only
```
"""
import argparse
import os
import re

View File

@@ -28,6 +28,7 @@ that new pipelines are properly added as metadata (as used in `make repo-consist
python utils/update_metadata.py --check-only
```
"""
import argparse
import collections
import os

View File

@@ -20,7 +20,6 @@ version of `tests/utils/tiny_model_summary.json`. That updated file should be me
`transformers` so the pipeline testing will use the latest created/updated tiny models.
"""
import argparse
import copy
import json