Skip to content

Commit 4aaf078

Browse files
committed
Format code
1 parent 77f512b commit 4aaf078

File tree

7 files changed

+23
-11
lines changed

7 files changed

+23
-11
lines changed

scripts/autogen.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,11 @@ def make_md_source_for_entry(self, entry, path_stack, title_stack):
568568
metadata = json.dumps(
569569
{
570570
"location_history": location_history[:-1],
571-
"outline": autogen_utils.make_outline(template)
572-
if entry.get("outline", True)
573-
else [],
571+
"outline": (
572+
autogen_utils.make_outline(template)
573+
if entry.get("outline", True)
574+
else []
575+
),
574576
"location": "/"
575577
+ "/".join([s.replace("/", "") for s in path_stack])
576578
+ "/",
@@ -1132,17 +1134,19 @@ def get_working_dir(arg):
11321134
refresh_guides=False,
11331135
refresh_examples=False,
11341136
)
1135-
1137+
error_msg = (
1138+
"Must specify command " "`make`, `serve`, `add_example`, or `add_guide`."
1139+
)
1140+
if len(sys.argv) < 2:
1141+
raise ValueError(error_msg)
11361142
cmd = sys.argv[1]
11371143
if cmd not in {
11381144
"make",
11391145
"serve",
11401146
"add_example",
11411147
"add_guide",
11421148
}:
1143-
raise ValueError(
1144-
"Must specify command `make`, `serve`, `add_example`, or `add_guide`."
1145-
)
1149+
raise ValueError(error_msg)
11461150
if cmd in {"add_example", "add_guide"}:
11471151
if not len(sys.argv) in (3, 4):
11481152
raise ValueError(

scripts/docstrings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Lightweight fork of Keras-Autodocs.
22
"""
3+
34
import warnings
45
import black
56
import re

scripts/examples_master.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,15 +853,21 @@
853853
"subcategory": "Speech recognition",
854854
"keras_3": True,
855855
},
856-
# Will be autogenerated
856+
# Rest will be autogenerated
857857
],
858858
},
859859
{
860860
"path": "rl/",
861861
"title": "Reinforcement Learning",
862862
"toc": True,
863863
"children": [
864-
# Will be autogenerated
864+
{
865+
"path": "actor_critic_cartpole",
866+
"title": "Actor Critic Method",
867+
"subcategory": "RL algorithms",
868+
"keras_3": True,
869+
}
870+
# Rest will be autogenerated
865871
],
866872
},
867873
{

scripts/nlp_api_master.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
},
6666
],
6767
},
68-
6968
{
7069
"path": "bart/",
7170
"title": "Bart",
@@ -307,7 +306,6 @@
307306
},
308307
],
309308
},
310-
311309
{
312310
"path": "gemma/",
313311
"title": "Gemma",

scripts/render_tags.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
'path': Relative path of the model on keras.io,
1111
}
1212
"""
13+
1314
import inspect
1415

1516
try:

scripts/tutobooks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
6161
Finally, submit a PR adding `examples/your_example.py`.
6262
"""
63+
6364
import os
6465
import sys
6566
import json

scripts/upload_to_gcs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
2323
After upload, you may need to invalidate the CDN cache.
2424
"""
25+
2526
import os
2627
import pathlib
2728

0 commit comments

Comments
 (0)