Skip to content

Commit 0765948

Browse files
authored
Merge branch 'TheAlgorithms:master' into create-wa-tor-algorithm
2 parents f79680b + 46454e2 commit 0765948

File tree

7 files changed

+131
-134
lines changed

7 files changed

+131
-134
lines changed

Diff for: .devcontainer/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ ARG VARIANT=3.11-bookworm
33
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
44
COPY requirements.txt /tmp/pip-tmp/
55
RUN python3 -m pip install --upgrade pip \
6-
&& python3 -m pip install --no-cache-dir install ruff -r /tmp/pip-tmp/requirements.txt
6+
&& python3 -m pip install --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
7+
&& pipx install pre-commit ruff \
8+
&& pre-commit install

Diff for: ciphers/diffie_hellman.py

+122-122
Large diffs are not rendered by default.

Diff for: compression/burrows_wheeler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def reverse_bwt(bwt_string: str, idx_original_string: int) -> str:
150150
raise ValueError("The parameter idx_original_string must not be lower than 0.")
151151
if idx_original_string >= len(bwt_string):
152152
raise ValueError(
153-
"The parameter idx_original_string must be lower than" " len(bwt_string)."
153+
"The parameter idx_original_string must be lower than len(bwt_string)."
154154
)
155155

156156
ordered_rotations = [""] * len(bwt_string)

Diff for: neural_network/input_data.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,7 @@ def _maybe_download(filename, work_directory, source_url):
263263
return filepath
264264

265265

266-
@deprecated(
267-
None, "Please use alternatives such as:" " tensorflow_datasets.load('mnist')"
268-
)
266+
@deprecated(None, "Please use alternatives such as: tensorflow_datasets.load('mnist')")
269267
def read_data_sets(
270268
train_dir,
271269
fake_data=False,

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ select = [ # https://beta.ruff.rs/docs/rules
4949
"ICN", # flake8-import-conventions
5050
"INP", # flake8-no-pep420
5151
"INT", # flake8-gettext
52+
"ISC", # flake8-implicit-str-concat
5253
"N", # pep8-naming
5354
"NPY", # NumPy-specific rules
5455
"PGH", # pygrep-hooks
@@ -72,7 +73,6 @@ select = [ # https://beta.ruff.rs/docs/rules
7273
# "DJ", # flake8-django
7374
# "ERA", # eradicate -- DO NOT FIX
7475
# "FBT", # flake8-boolean-trap # FIX ME
75-
# "ISC", # flake8-implicit-str-concat # FIX ME
7676
# "PD", # pandas-vet
7777
# "PT", # flake8-pytest-style
7878
# "PTH", # flake8-use-pathlib # FIX ME

Diff for: strings/is_srilankan_phone_number.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ def is_sri_lankan_phone_number(phone: str) -> bool:
2222
False
2323
"""
2424

25-
pattern = re.compile(
26-
r"^(?:0|94|\+94|0{2}94)" r"7(0|1|2|4|5|6|7|8)" r"(-| |)" r"\d{7}$"
27-
)
25+
pattern = re.compile(r"^(?:0|94|\+94|0{2}94)7(0|1|2|4|5|6|7|8)(-| |)\d{7}$")
2826

2927
return bool(re.search(pattern, phone))
3028

Diff for: web_programming/world_covid19_stats.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ def world_covid19_stats(url: str = "https://www.worldometers.info/coronavirus")
2222

2323

2424
if __name__ == "__main__":
25-
print("\033[1m" + "COVID-19 Status of the World" + "\033[0m\n")
26-
for key, value in world_covid19_stats().items():
27-
print(f"{key}\n{value}\n")
25+
print("\033[1m COVID-19 Status of the World \033[0m\n")
26+
print("\n".join(f"{key}\n{value}" for key, value in world_covid19_stats().items()))

0 commit comments

Comments
 (0)