Skip to content

Commit d9347c5

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 57dba24 commit d9347c5

21 files changed

Lines changed: 218 additions & 93 deletions

File tree

docs/data-processing/apis/fastapi/example.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Create a file :file:`main.py` with:
1616
1717
from fastapi import FastAPI
1818
19-
2019
app = FastAPI()
2120
2221
@@ -77,7 +76,6 @@ Now we modify the file ``main.py`` to receive a body from a ``PUT`` request:
7776
7877
from fastapi import FastAPI
7978
80-
8179
app = FastAPI()
8280
8381

docs/data-processing/apis/grpc/accounts_pb2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@
292292
_GETACCOUNTSREQUEST.fields_by_name["account"].message_type = _ACCOUNT
293293
_GETACCOUNTSRESULT.fields_by_name["account"].message_type = _ACCOUNT
294294
DESCRIPTOR.message_types_by_name["Account"] = _ACCOUNT
295-
DESCRIPTOR.message_types_by_name["CreateAccountRequest"] = _CREATEACCOUNTREQUEST
295+
DESCRIPTOR.message_types_by_name["CreateAccountRequest"] = (
296+
_CREATEACCOUNTREQUEST
297+
)
296298
DESCRIPTOR.message_types_by_name["CreateAccountResult"] = _CREATEACCOUNTRESULT
297299
DESCRIPTOR.message_types_by_name["GetAccountsRequest"] = _GETACCOUNTSREQUEST
298300
DESCRIPTOR.message_types_by_name["GetAccountsResult"] = _GETACCOUNTSRESULT

docs/data-processing/apis/grpc/tests/test_accounts.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ def test_create_account(grpc_stub):
3636
request = CreateAccountRequest(account_name=value)
3737
response = grpc_stub.CreateAccount(request)
3838

39-
assert f"{response.account}" == f'account_id: 1{nl}account_name: "test-data"{nl}'
39+
assert (
40+
f"{response.account}"
41+
== f'account_id: 1{nl}account_name: "test-data"{nl}'
42+
)
4043

4144

4245
def test_get_accounts(grpc_stub):
@@ -64,7 +67,9 @@ def grpc_server(_grpc_server, grpc_addr, my_ssl_key_path, my_ssl_cert_path):
6467
@pytest.fixture(scope="module")
6568
def my_channel_ssl_credentials(my_ssl_cert_path):
6669
# If we're using self-signed certificate it's necessarily to pass root certificate to channel
67-
return grpc.ssl_channel_credentials(root_certificates=my_ssl_cert_path.read_bytes())
70+
return grpc.ssl_channel_credentials(
71+
root_certificates=my_ssl_cert_path.read_bytes()
72+
)
6873

6974

7075
@pytest.fixture(scope="module")

docs/data-processing/postgresql/sqlalchemy.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Database connection
4444
4545
from sqlalchemy import create_engine
4646
47-
4847
engine = create_engine("postgresql:///example", echo=True)
4948
5049
Data model
@@ -56,7 +55,6 @@ Data model
5655
from sqlalchemy.ext.declarative import declarative_base
5756
from sqlalchemy.orm import relationship
5857
59-
6058
Base = declarative_base()
6159
6260

docs/data-processing/serialisation-formats/toml/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Overview
3939
4040
import toml
4141
42-
4342
config = toml.load("pyproject.toml")
4443
4544
.. seealso::

docs/performance/index.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ We can create sample data with:
5252
5353
from sklearn.datasets import make_blobs
5454
55-
5655
points, labels_true = make_blobs(
5756
n_samples=1000, centers=3, random_state=0, cluster_std=0.60
5857
)
@@ -133,7 +132,6 @@ algorithm:
133132
134133
from sklearn.cluster import KMeans
135134
136-
137135
KMeans(10).fit_predict(points)
138136
139137
* `dask_ml.cluster.KMeans
@@ -143,7 +141,6 @@ algorithm:
143141
144142
from dask_ml.cluster import KMeans
145143
146-
147144
KMeans(10).fit(points).predict(points)
148145
149146
The best that could be said against these existing solutions is that they could

docs/performance/nb_kmeans.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def compute_centers(points, labels):
4141
counts[label] += 1
4242
centers[label] = [a + b for a, b in zip(centers[label], point)]
4343

44-
return [[x / count for x in center] for center, count in zip(centers, counts)]
44+
return [
45+
[x / count for x in center] for center, count in zip(centers, counts)
46+
]
4547

4648

4749
def kmeans(points, n_clusters):

docs/performance/np_kmeans.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def compute_centers(points, labels):
2424
counts[label] += 1
2525
centers[label] = [a + b for a, b in zip(centers[label], point)]
2626

27-
return [[x / count for x in center] for center, count in zip(centers, counts)]
27+
return [
28+
[x / count for x in center] for center, count in zip(centers, counts)
29+
]
2830

2931

3032
def kmeans(points, n_clusters):

docs/performance/py_kmeans.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def compute_centers(points, labels):
2929
counts[label] += 1
3030
centers[label] = [a + b for a, b in zip(centers[label], point)]
3131

32-
return [[x / count for x in center] for center, count in zip(centers, counts)]
32+
return [
33+
[x / count for x in center] for center, count in zip(centers, counts)
34+
]
3335

3436

3537
def kmeans(points, n_clusters):

docs/productive/qa/requests/__init__.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@
5757
chardet_version = None
5858

5959

60-
def check_compatibility(urllib3_version, chardet_version, charset_normalizer_version):
60+
def check_compatibility(
61+
urllib3_version, chardet_version, charset_normalizer_version
62+
):
6163
urllib3_version = urllib3_version.split(".")
62-
assert urllib3_version != ["dev"] # Verify urllib3 isn't installed from git.
64+
assert urllib3_version != [
65+
"dev"
66+
] # Verify urllib3 isn't installed from git.
6367

6468
# Sometimes, urllib3 only reports its version as 16.1.
6569
if len(urllib3_version) == 2:
@@ -85,7 +89,9 @@ def check_compatibility(urllib3_version, chardet_version, charset_normalizer_ver
8589
# charset_normalizer >= 2.0.0 < 3.0.0
8690
assert (2, 0, 0) <= (major, minor, patch) < (3, 0, 0)
8791
else:
88-
raise Exception("You need either charset_normalizer or chardet installed")
92+
raise Exception(
93+
"You need either charset_normalizer or chardet installed"
94+
)
8995

9096

9197
def _check_cryptography(cryptography_version):
@@ -96,8 +102,10 @@ def _check_cryptography(cryptography_version):
96102
return
97103

98104
if cryptography_version < [1, 3, 4]:
99-
warning = "Old version of cryptography ({}) may cause slowdown.".format(
100-
cryptography_version
105+
warning = (
106+
"Old version of cryptography ({}) may cause slowdown.".format(
107+
cryptography_version
108+
)
101109
)
102110
warnings.warn(warning, RequestsDependencyWarning)
103111

0 commit comments

Comments
 (0)