Skip to content

Commit 9e1923a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 51e03af commit 9e1923a

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

amlb/utils/core.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,15 @@ def as_list(*args):
300300
def flatten(iterable, flatten_tuple=False, flatten_dict=False):
301301
return reduce(
302302
lambda left, right: (
303-
left.extend(right)
304-
if isinstance(right, (list, tuple) if flatten_tuple else list)
305-
else left.extend(right.items())
306-
if flatten_dict and isinstance(right, dict)
307-
else left.append(right)
308-
)
309-
or left,
303+
(
304+
left.extend(right)
305+
if isinstance(right, (list, tuple) if flatten_tuple else list)
306+
else left.extend(right.items())
307+
if flatten_dict and isinstance(right, dict)
308+
else left.append(right)
309+
)
310+
or left
311+
),
310312
iterable,
311313
[],
312314
)

amlb/utils/os.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,10 @@ def add_to_archive(file, isdir):
195195
walk_apply(
196196
path,
197197
add_to_archive,
198-
filter_=lambda p: (filter_ is None or filter_(p))
199-
and not os.path.samefile(dest_archive, p),
198+
filter_=lambda p: (
199+
(filter_ is None or filter_(p))
200+
and not os.path.samefile(dest_archive, p)
201+
),
200202
)
201203

202204

frameworks/H2OAutoML/exec.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,10 @@ def save_artifacts(automl, dataset, config):
283283
models_artifacts.append(models_archive)
284284
clean_dir(
285285
models_dir,
286-
filter_=lambda p: p not in models_artifacts
287-
and os.path.splitext(p)[1] in [".json", ".zip", ""],
286+
filter_=lambda p: (
287+
p not in models_artifacts
288+
and os.path.splitext(p)[1] in [".json", ".zip", ""]
289+
),
288290
)
289291

290292
if "model_predictions" in artifacts:

0 commit comments

Comments
 (0)