Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Feb 22, 2024
1 parent 77f512b commit 4aaf078
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
18 changes: 11 additions & 7 deletions scripts/autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,11 @@ def make_md_source_for_entry(self, entry, path_stack, title_stack):
metadata = json.dumps(
{
"location_history": location_history[:-1],
"outline": autogen_utils.make_outline(template)
if entry.get("outline", True)
else [],
"outline": (
autogen_utils.make_outline(template)
if entry.get("outline", True)
else []
),
"location": "/"
+ "/".join([s.replace("/", "") for s in path_stack])
+ "/",
Expand Down Expand Up @@ -1132,17 +1134,19 @@ def get_working_dir(arg):
refresh_guides=False,
refresh_examples=False,
)

error_msg = (
"Must specify command " "`make`, `serve`, `add_example`, or `add_guide`."
)
if len(sys.argv) < 2:
raise ValueError(error_msg)
cmd = sys.argv[1]
if cmd not in {
"make",
"serve",
"add_example",
"add_guide",
}:
raise ValueError(
"Must specify command `make`, `serve`, `add_example`, or `add_guide`."
)
raise ValueError(error_msg)
if cmd in {"add_example", "add_guide"}:
if not len(sys.argv) in (3, 4):
raise ValueError(
Expand Down
1 change: 1 addition & 0 deletions scripts/docstrings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Lightweight fork of Keras-Autodocs.
"""

import warnings
import black
import re
Expand Down
10 changes: 8 additions & 2 deletions scripts/examples_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,15 +853,21 @@
"subcategory": "Speech recognition",
"keras_3": True,
},
# Will be autogenerated
# Rest will be autogenerated
],
},
{
"path": "rl/",
"title": "Reinforcement Learning",
"toc": True,
"children": [
# Will be autogenerated
{
"path": "actor_critic_cartpole",
"title": "Actor Critic Method",
"subcategory": "RL algorithms",
"keras_3": True,
}
# Rest will be autogenerated
],
},
{
Expand Down
2 changes: 0 additions & 2 deletions scripts/nlp_api_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
},
],
},

{
"path": "bart/",
"title": "Bart",
Expand Down Expand Up @@ -307,7 +306,6 @@
},
],
},

{
"path": "gemma/",
"title": "Gemma",
Expand Down
1 change: 1 addition & 0 deletions scripts/render_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'path': Relative path of the model on keras.io,
}
"""

import inspect

try:
Expand Down
1 change: 1 addition & 0 deletions scripts/tutobooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
Finally, submit a PR adding `examples/your_example.py`.
"""

import os
import sys
import json
Expand Down
1 change: 1 addition & 0 deletions scripts/upload_to_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
After upload, you may need to invalidate the CDN cache.
"""

import os
import pathlib

Expand Down

0 comments on commit 4aaf078

Please sign in to comment.