Skip to content

Commit 1b26e7c

Browse files
[pre-commit.ci] pre-commit autoupdate (#381)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 21.12b0 → 22.1.0](psf/black@21.12b0...22.1.0) - [github.com/Lucas-C/pre-commit-hooks: v1.1.10 → v1.1.11](Lucas-C/pre-commit-hooks@v1.1.10...v1.1.11) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ec43380 commit 1b26e7c

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ repos:
4747

4848
# Black, the code formatter, natively supports pre-commit
4949
- repo: https://github.com/psf/black
50-
rev: 21.12b0 # Keep in sync with blacken-docs
50+
rev: 22.1.0 # Keep in sync with blacken-docs
5151
hooks:
5252
- id: black
5353
exclude: ^pii_processing/
5454

5555
# Changes tabs to spaces
5656
- repo: https://github.com/Lucas-C/pre-commit-hooks
57-
rev: v1.1.10
57+
rev: v1.1.11
5858
hooks:
5959
- id: remove-tabs
6060
exclude: ^(pii_processing|.*Makefile)

kenlm_training/cc_net/jsonql.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ def open_write(
10191019

10201020

10211021
def parse_size(size):
1022-
unit_map = {"B": 1, "K": 1024, "M": 1024 ** 2, "G": 1024 ** 3}
1022+
unit_map = {"B": 1, "K": 1024, "M": 1024**2, "G": 1024**3}
10231023
unit = size[-1].upper()
10241024
assert (
10251025
unit in unit_map
@@ -1102,7 +1102,7 @@ def request_get_content(url: str, n_retry: int = 3) -> bytes:
11021102
warnings.warn(
11031103
f"Swallowed error {e} while downloading {url} ({i} out of {n_retry})"
11041104
)
1105-
time.sleep(10 * 2 ** i)
1105+
time.sleep(10 * 2**i)
11061106
dl_time = time.time() - t0
11071107
dl_speed = len(r.content) / dl_time / 1024
11081108
logging.info(
@@ -1148,7 +1148,7 @@ def sharded_file(file_pattern: Path, mode: str, max_size: str = "4G") -> MultiFi
11481148
assert 0 < n < 8
11491149
assert "?" * n in name, f"The '?' need to be adjacents in {file_pattern}"
11501150
assert "r" not in mode
1151-
files = (folder / name.replace("?" * n, f"%0{n}d" % i) for i in range(10 ** n))
1151+
files = (folder / name.replace("?" * n, f"%0{n}d" % i) for i in range(10**n))
11521152

11531153
return MultiFile(files, mode, max_size)
11541154

kenlm_training/cc_net/regroup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def fast_reshard(
105105

106106

107107
def determine_groups(
108-
inputs: List[Path], target_size: int = 4 * 1024 ** 3
108+
inputs: List[Path], target_size: int = 4 * 1024**3
109109
) -> List[List[Path]]:
110110
if len(inputs) == 0:
111111
return []

kenlm_training/cc_net/tools/expand_corpus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
KENLM = Path("./bin/lmplz")
2828
KENLM_BUILD = Path("./bin/build_binary")
29-
VOCAB_SIZE = 2 ** 16 - 10
29+
VOCAB_SIZE = 2**16 - 10
3030
PROCESSES = 16
3131

3232

kenlm_training/tests/test_flat_hash_set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def check_reload(h, dump, load, tmp_path):
6969
@pytest.mark.parametrize("hash_set_cls", [FlatHashSet, NaiveHashSet])
7070
def test_loading(tmp_path, hash_set_cls):
7171
h = hash_set_cls()
72-
x = np.random.randint(0, 2 ** 32, (100,), dtype=h.dtype)
72+
x = np.random.randint(0, 2**32, (100,), dtype=h.dtype)
7373
h.add(x)
7474

7575
check_reload(h, hash_set_cls.dump, hash_set_cls.load, tmp_path)

0 commit comments

Comments
 (0)