Skip to content

Commit 7dde146

Browse files
committed
automatic code refactor
1 parent bb6ceb4 commit 7dde146

8 files changed

Lines changed: 17 additions & 12 deletions

File tree

wolframclient/evaluation/cloud/asynccloudsession.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
XAuthAIOHttpAsyncSession as XAuthAsyncSession,
1212
)
1313
from wolframclient.evaluation.cloud.base import WolframAPICallBase
14-
from wolframclient.evaluation.cloud.server import WOLFRAM_PUBLIC_CLOUD_SERVER, DEFAULT_CA_PATH
14+
from wolframclient.evaluation.cloud.server import DEFAULT_CA_PATH, WOLFRAM_PUBLIC_CLOUD_SERVER
1515
from wolframclient.evaluation.result import (
1616
WolframAPIResponseBuilder,
1717
WolframEvaluationWXFResponseAsync,
@@ -70,7 +70,6 @@ def __init__(
7070
else:
7171
self._ssl_context = None
7272

73-
7473
def duplicate(self):
7574
return self.__class__(
7675
credentials=self.credentials,

wolframclient/evaluation/cloud/asyncoauth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import absolute_import, print_function, unicode_literals
22

33
import logging
4+
45
from wolframclient.evaluation.cloud.base import OAuthAsyncSessionBase, UserIDPassword
56
from wolframclient.evaluation.cloud.server import DEFAULT_CA_PATH
67
from wolframclient.exception import AuthenticationException

wolframclient/evaluation/cloud/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from __future__ import absolute_import, print_function, unicode_literals
22

33
from wolframclient.utils import six
4+
45
try:
56
import certifi
7+
68
DEFAULT_CA_PATH = certifi.where()
79
except ImportError:
810
certifi = None

wolframclient/serializers/encoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from functools import partial
77

88
from wolframclient.serializers.utils import safe_len
9-
from wolframclient.utils.api import pkg_resources, multithreading
9+
from wolframclient.utils.api import multithreading, pkg_resources
1010
from wolframclient.utils.dispatch import Dispatch
1111
from wolframclient.utils.functional import composition, is_iterable, iterate, map
1212
from wolframclient.utils.importutils import safe_import_string

wolframclient/tests/deserializers/wxf_deserialize.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,11 @@ def test_bigreal_precision_exponent(self):
148148
self.assertEqual(res, decimal.Decimal("9.999999999999996843873323328588479844E+999"))
149149

150150
def test_bigreal_precision_negexponent(self):
151-
wxf = b'8:RC4.590261537982443550699999999999999999999281`19.66183743091127*^-16'
152-
res = binary_deserialize(wxf, consumer=WXFConsumer())
153-
self.assertEqual(res, decimal.Decimal('4.590261537982443550699999999999999999999281E-16'))
151+
wxf = b"8:RC4.590261537982443550699999999999999999999281`19.66183743091127*^-16"
152+
res = binary_deserialize(wxf, consumer=WXFConsumer())
153+
self.assertEqual(
154+
res, decimal.Decimal("4.590261537982443550699999999999999999999281E-16")
155+
)
154156

155157
def test_empty_lists(self):
156158
value = ((), ((),), (1, ()), ())

wolframclient/tests/evaluation/test_async_cloud.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ async def test_bad_sak_with(self):
143143

144144
def test_sslcontext(self):
145145
from wolframclient.evaluation.cloud.server import DEFAULT_CA_PATH
146+
146147
s = WolframCloudAsyncSession()
147148
if DEFAULT_CA_PATH is None:
148149
self.assertIsNone(s._ssl_context)

wolframclient/utils/api.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@
139139
)
140140

141141
multithreading = API(Lock="wolframclient.utils.lock.Lock")
142-
pkg_resources = API(iter_entry_points=("pkg_resources.iter_entry_points", lambda *args, **opts: ()))
142+
pkg_resources = API(
143+
iter_entry_points=("pkg_resources.iter_entry_points", lambda *args, **opts: ())
144+
)
143145

144146
PIL = API(Image="PIL.Image.Image", fromarray="PIL.Image.fromarray", open="PIL.Image.open")
145147

@@ -169,10 +171,7 @@
169171
StringPayload="aiohttp.StringPayload",
170172
)
171173

172-
ssl = API(
173-
SSLContext="ssl.SSLContext",
174-
create_default_context="ssl.create_default_context",
175-
)
174+
ssl = API(SSLContext="ssl.SSLContext", create_default_context="ssl.create_default_context")
176175

177176
externalevaluate = API(
178177
execute_from_file="wolframclient.utils.externalevaluate.execute_from_file",

wolframclient/utils/lock.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
from wolframclient.utils.importutils import safe_import_string_and_call
44

55
try:
6-
_lock = safe_import_string_and_call('multithreading.Lock')
6+
_lock = safe_import_string_and_call("multithreading.Lock")
77

88
def Lock():
99
return _lock
1010

11+
1112
except (ImportError, OSError):
1213

1314
# JYTHON is raising an ImportError when running "import multiprocessing"

0 commit comments

Comments
 (0)