Skip to content

Commit b14d59e

Browse files
committed
format
Signed-off-by: Trevor Madge <tmadge@paloaltonetworks.com>
1 parent 656b203 commit b14d59e

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

modelscan/scanners/saved_model/scan.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ def _load_safe_operators() -> List[str]:
5757
try:
5858
with open(operators_file, "r") as f:
5959
data = json.load(f)
60-
return [
61-
operator for operator in list(data.get("operators", [])) if operator[0] != "_"
60+
return [
61+
operator
62+
for operator in list(data.get("operators", []))
63+
if operator[0] != "_"
6264
]
6365

6466
except (FileNotFoundError, json.JSONDecodeError) as e:

scripts/update_tensorflow_operators.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
from typing import List, Dict, Any
2121

2222

23-
def update_operators_json(
24-
json_path: Path
25-
) -> None:
23+
def update_operators_json(json_path: Path) -> None:
2624
"""
2725
Update the JSON file with new version and operators.
2826
@@ -41,14 +39,17 @@ def update_operators_json(
4139
for op in tf.raw_ops.__dict__.keys():
4240
operators.append(op)
4341
data = {}
44-
data['description'] = "List of known TensorFlow raw operators from tensorflow.raw_ops.__dict__.keys()"
45-
data['version'] = version
46-
data['operators'] = operators
42+
data["description"] = (
43+
"List of known TensorFlow raw operators from tensorflow.raw_ops.__dict__.keys()"
44+
)
45+
data["version"] = version
46+
data["operators"] = operators
4747

4848
# Write updated file with nice formatting
49-
with open(json_path, 'w') as f:
49+
with open(json_path, "w") as f:
5050
json.dump(data, f, indent=2)
5151

52+
5253
def main():
5354
"""Main entry point."""
5455
# Determine paths

0 commit comments

Comments
 (0)