Skip to content

Commit 68551cf

Browse files
aronphilandstuff
authored andcommitted
Linting
1 parent 302f5da commit 68551cf

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

replicate/helpers.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ def encode_json(
4444
if isinstance(obj, io.IOBase):
4545
if file_encoding_strategy == "base64":
4646
return base64_encode_file(obj)
47-
else:
48-
return client.files.create(obj).urls["get"]
47+
return client.files.create(obj).urls["get"]
4948
if HAS_NUMPY:
5049
if isinstance(obj, np.integer): # type: ignore
5150
return int(obj)
@@ -82,8 +81,7 @@ async def async_encode_json(
8281
if file_encoding_strategy == "base64":
8382
# TODO: This should ideally use an async based file reader path.
8483
return base64_encode_file(obj)
85-
else:
86-
return (await client.files.async_create(obj)).urls["get"]
84+
return (await client.files.async_create(obj)).urls["get"]
8785
if HAS_NUMPY:
8886
if isinstance(obj, np.integer): # type: ignore
8987
return int(obj)
@@ -183,9 +181,9 @@ def transform_output(value: Any, client: "Client") -> Any:
183181
def transform(obj: Any) -> Any:
184182
if isinstance(obj, Mapping):
185183
return {k: transform(v) for k, v in obj.items()}
186-
elif isinstance(obj, Sequence) and not isinstance(obj, str):
184+
if isinstance(obj, Sequence) and not isinstance(obj, str):
187185
return [transform(item) for item in obj]
188-
elif isinstance(obj, str) and (
186+
if isinstance(obj, str) and (
189187
obj.startswith("https:") or obj.startswith("data:")
190188
):
191189
return FileOutput(obj, client)

replicate/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def run(
3838

3939
if "wait" not in params:
4040
params["wait"] = True
41-
is_blocking = params["wait"] != False # noqa: E712
41+
is_blocking = params["wait"] is not False
4242

4343
version, owner, name, version_id = identifier._resolve(ref)
4444

@@ -108,7 +108,7 @@ async def async_run(
108108

109109
if "wait" not in params:
110110
params["wait"] = True
111-
is_blocking = params["wait"] != False # noqa: E712
111+
is_blocking = params["wait"] is not False
112112

113113
version, owner, name, version_id = identifier._resolve(ref)
114114

0 commit comments

Comments
 (0)