From 82bd253f9b662c00f5018d10526acb8f62ce177a Mon Sep 17 00:00:00 2001
From: KaixLina <128913081+KaixLina@users.noreply.github.com>
Date: Sun, 26 Mar 2023 09:16:54 +0530
Subject: [PATCH 1/9] New gitter link added
---
.github/stale.yml | 4 ++--
CONTRIBUTING.md | 4 ++--
README.md | 4 ++--
project_euler/README.md | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/.github/stale.yml b/.github/stale.yml
index 36ca56266b26..813f688348d8 100644
--- a/.github/stale.yml
+++ b/.github/stale.yml
@@ -45,7 +45,7 @@ pulls:
closeComment: >
Please reopen this pull request once you commit the changes requested
or make improvements on the code. If this is not the case and you need
- some help, feel free to seek help from our [Gitter](https://gitter.im/TheAlgorithms)
+ some help, feel free to seek help from our [Gitter](https://app.gitter.im/#/room/#TheAlgorithms_community:gitter.im)
or ping one of the reviewers. Thank you for your contributions!
issues:
@@ -59,5 +59,5 @@ issues:
closeComment: >
Please reopen this issue once you add more information and updates here.
If this is not the case and you need some help, feel free to seek help
- from our [Gitter](https://gitter.im/TheAlgorithms) or ping one of the
+ from our [Gitter](https://app.gitter.im/#/room/#TheAlgorithms_community:gitter.im) or ping one of the
reviewers. Thank you for your contributions!
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6b6e4d21bfc7..75e4fb893723 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,7 +2,7 @@
## Before contributing
-Welcome to [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python)! Before sending your pull requests, make sure that you __read the whole guidelines__. If you have any doubt on the contributing guide, please feel free to [state it clearly in an issue](https://github.com/TheAlgorithms/Python/issues/new) or ask the community in [Gitter](https://gitter.im/TheAlgorithms).
+Welcome to [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python)! Before sending your pull requests, make sure that you __read the whole guidelines__. If you have any doubt on the contributing guide, please feel free to [state it clearly in an issue](https://github.com/TheAlgorithms/Python/issues/new) or ask the community in [Gitter](https://app.gitter.im/#/room/#TheAlgorithms_community:gitter.im).
## Contributing
@@ -176,7 +176,7 @@ We want your work to be readable by others; therefore, we encourage you to note
- Most importantly,
- __Be consistent in the use of these guidelines when submitting.__
- - __Join__ us on [Discord](https://discord.com/invite/c7MnfGFGa6) and [Gitter](https://gitter.im/TheAlgorithms) __now!__
+ - __Join__ us on [Discord](https://discord.com/invite/c7MnfGFGa6) and [Gitter](https://app.gitter.im/#/room/#TheAlgorithms_community:gitter.im) __now!__
- Happy coding!
Writer [@poyea](https://github.com/poyea), Jun 2019.
diff --git a/README.md b/README.md
index 68a6e5e6fbce..3d2f1a110780 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@
-
+
@@ -42,7 +42,7 @@ Read through our [Contribution Guidelines](CONTRIBUTING.md) before you contribut
## Community Channels
-We are on [Discord](https://discord.gg/c7MnfGFGa6) and [Gitter](https://gitter.im/TheAlgorithms)! Community channels are a great way for you to ask questions and get help. Please join us!
+We are on [Discord](https://discord.gg/c7MnfGFGa6) and [Gitter](https://app.gitter.im/#/room/#TheAlgorithms_community:gitter.im)! Community channels are a great way for you to ask questions and get help. Please join us!
## List of Algorithms
diff --git a/project_euler/README.md b/project_euler/README.md
index e3dc035eee5e..4832d0078ebf 100644
--- a/project_euler/README.md
+++ b/project_euler/README.md
@@ -10,7 +10,7 @@ The solutions will be checked by our [automated testing on GitHub Actions](https
## Solution Guidelines
-Welcome to [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python)! Before reading the solution guidelines, make sure you read the whole [Contributing Guidelines](https://github.com/TheAlgorithms/Python/blob/master/CONTRIBUTING.md) as it won't be repeated in here. If you have any doubt on the guidelines, please feel free to [state it clearly in an issue](https://github.com/TheAlgorithms/Python/issues/new) or ask the community in [Gitter](https://gitter.im/TheAlgorithms). You can use the [template](https://github.com/TheAlgorithms/Python/blob/master/project_euler/README.md#solution-template) we have provided below as your starting point but be sure to read the [Coding Style](https://github.com/TheAlgorithms/Python/blob/master/project_euler/README.md#coding-style) part first.
+Welcome to [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python)! Before reading the solution guidelines, make sure you read the whole [Contributing Guidelines](https://github.com/TheAlgorithms/Python/blob/master/CONTRIBUTING.md) as it won't be repeated in here. If you have any doubt on the guidelines, please feel free to [state it clearly in an issue](https://github.com/TheAlgorithms/Python/issues/new) or ask the community in [Gitter](https://app.gitter.im/#/room/#TheAlgorithms_community:gitter.im). You can use the [template](https://github.com/TheAlgorithms/Python/blob/master/project_euler/README.md#solution-template) we have provided below as your starting point but be sure to read the [Coding Style](https://github.com/TheAlgorithms/Python/blob/master/project_euler/README.md#coding-style) part first.
### Coding Style
From 4449743f0505416f93d219afdb45547f1251a50f Mon Sep 17 00:00:00 2001
From: Christian Clauss
Date: Sun, 26 Mar 2023 07:02:36 +0200
Subject: [PATCH 2/9] ruff==0.0.258
---
.github/workflows/ruff.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml
index ca2d5be47327..51736526960e 100644
--- a/.github/workflows/ruff.yml
+++ b/.github/workflows/ruff.yml
@@ -12,5 +12,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- - run: pip install --user ruff
+ - run: pip install --user ruff==0.0.258
- run: ruff --format=github .
From 71d453b138affcbd671bc25118ad717691ecbb4b Mon Sep 17 00:00:00 2001
From: Christian Clauss
Date: Sun, 26 Mar 2023 07:14:22 +0200
Subject: [PATCH 3/9] noqa: S310
---
machine_learning/sequential_minimum_optimization.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/machine_learning/sequential_minimum_optimization.py b/machine_learning/sequential_minimum_optimization.py
index b68bd52f4de9..b24f5669e2e8 100644
--- a/machine_learning/sequential_minimum_optimization.py
+++ b/machine_learning/sequential_minimum_optimization.py
@@ -458,7 +458,7 @@ def test_cancel_data():
CANCER_DATASET_URL,
headers={"User-Agent": "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)"},
)
- response = urllib.request.urlopen(request)
+ response = urllib.request.urlopen(request) # noqa: S310
content = response.read().decode("utf-8")
with open(r"cancel_data.csv", "w") as f:
f.write(content)
From 1c575b42cfd203bec0b83f80c54ba0c62cb29aa0 Mon Sep 17 00:00:00 2001
From: Christian Clauss
Date: Sun, 26 Mar 2023 07:21:58 +0200
Subject: [PATCH 4/9] noqa: S310
---
web_programming/download_images_from_google_query.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web_programming/download_images_from_google_query.py b/web_programming/download_images_from_google_query.py
index 9c0c21dc804e..441347459f8e 100644
--- a/web_programming/download_images_from_google_query.py
+++ b/web_programming/download_images_from_google_query.py
@@ -86,7 +86,7 @@ def download_images_from_google_query(query: str = "dhaka", max_images: int = 5)
path_name = f"query_{query.replace(' ', '_')}"
if not os.path.exists(path_name):
os.makedirs(path_name)
- urllib.request.urlretrieve(
+ urllib.request.urlretrieve( # noqa: S310
original_size_img, f"{path_name}/original_size_img_{index}.jpg"
)
return index
From 9882333b80ab59431d74930fee8edbe50fe15429 Mon Sep 17 00:00:00 2001
From: Christian Clauss
Date: Sun, 26 Mar 2023 07:26:52 +0200
Subject: [PATCH 5/9] Update ruff.yml
---
.github/workflows/ruff.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml
index 51736526960e..ca2d5be47327 100644
--- a/.github/workflows/ruff.yml
+++ b/.github/workflows/ruff.yml
@@ -12,5 +12,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- - run: pip install --user ruff==0.0.258
+ - run: pip install --user ruff
- run: ruff --format=github .
From 4b2f700f28d3dc359902e7fa52492a7d55b09e07 Mon Sep 17 00:00:00 2001
From: Christian Clauss
Date: Sun, 26 Mar 2023 07:31:09 +0200
Subject: [PATCH 6/9] Add Ruff rule S311
---
pyproject.toml | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyproject.toml b/pyproject.toml
index 169c3a71ba6c..23fe45e97d20 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -34,6 +34,7 @@ ignore = [ # `ruff rule S101` for a description of that rule
"S101", # S101: Use of `assert` detected -- DO NOT FIX
"S105", # S105: Possible hardcoded password: 'password'
"S113", # S113: Probable use of requests call without timeout
+ "S311", # S311: Standard pseudo-random generators are not suitable for cryptographic purposes
"UP038", # UP038: Use `X | Y` in `{}` call instead of `(X, Y)` -- DO NOT FIX
]
select = [ # https://beta.ruff.rs/docs/rules
From 5df0f7ed652125d837275b0fc639910c4fd79184 Mon Sep 17 00:00:00 2001
From: Christian Clauss
Date: Sun, 26 Mar 2023 07:34:38 +0200
Subject: [PATCH 7/9] Ruff v0.0.259
---
.pre-commit-config.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 58cec4ff6ee6..72a878387e15 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -16,7 +16,7 @@ repos:
- id: auto-walrus
- repo: https://github.com/charliermarsh/ruff-pre-commit
- rev: v0.0.257
+ rev: v0.0.259
hooks:
- id: ruff
From 15a88e678e42174e64533514fc21b80ec510a152 Mon Sep 17 00:00:00 2001
From: Christian Clauss
Date: Sun, 26 Mar 2023 08:00:39 +0200
Subject: [PATCH 8/9] return ("{:08x}" * 5).format(*self.h)
---
hashes/sha1.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hashes/sha1.py b/hashes/sha1.py
index 9f0437f208fa..b325ce3e43bb 100644
--- a/hashes/sha1.py
+++ b/hashes/sha1.py
@@ -124,7 +124,7 @@ def final_hash(self):
self.h[3] + d & 0xFFFFFFFF,
self.h[4] + e & 0xFFFFFFFF,
)
- return "%08x%08x%08x%08x%08x" % tuple(self.h)
+ return ("{:08x}" * 5).format(*self.h)
def test_sha1_hash():
From 9aa6731e0cbb70ff62c7a8427791981f1bb5b804 Mon Sep 17 00:00:00 2001
From: Christian Clauss
Date: Sun, 26 Mar 2023 08:06:54 +0200
Subject: [PATCH 9/9] pickle.load(f) # noqa: S301
---
neural_network/convolution_neural_network.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/neural_network/convolution_neural_network.py b/neural_network/convolution_neural_network.py
index bd0550212157..f5ec156f3593 100644
--- a/neural_network/convolution_neural_network.py
+++ b/neural_network/convolution_neural_network.py
@@ -77,7 +77,7 @@ def save_model(self, save_path):
def read_model(cls, model_path):
# read saved model
with open(model_path, "rb") as f:
- model_dic = pickle.load(f)
+ model_dic = pickle.load(f) # noqa: S301
conv_get = model_dic.get("conv1")
conv_get.append(model_dic.get("step_conv1"))