Add some comments about the changes.

This commit is contained in:
Vincent STRAGIER 2023-06-05 12:27:18 +02:00
parent e643f56b75
commit c09fc43d45

View File

@ -297,10 +297,12 @@ def analyze(
actions = (actions,) actions = (actions,)
actions = list(actions) actions = list(actions)
# Check if actions have been passed correctly
if not actions: if not actions:
raise ValueError("`actions` must be a list of strings.") raise ValueError("`actions` must be a list of strings.")
# For each action, check if it is valid
for action in actions: for action in actions:
if action not in ("emotion", "age", "gender", "race"): if action not in ("emotion", "age", "gender", "race"):
raise ValueError( raise ValueError(