Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkutaj/88954a1ed2bcf5977e9be963c0bbbf4f to your computer and use it in GitHub Desktop.
Save pkutaj/88954a1ed2bcf5977e9be963c0bbbf4f to your computer and use it in GitHub Desktop.
SSAP-44.03-State-Machine-for-Log-Reducer9.py
def get_action(line, cur_state, event):
try:
return TRANSITIONS[cur_state][event][0]
except KeyError:
print_header("ERROR")
print(f"Affected line:\n\n"
f'\t>>> {line}\n'
f"The corresponding event '{event}' is not available for cur_state '{cur_state}'\n")
exit("~~> the input file seems malformed; Fix and try again.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment