stable_learning_control.utils.safer_eval_util
A module that makes eval calls inside the utility scripts safer.
This is done by setting the globals to a dictionary containing only modules we want the end user to access. This way, users can not use the eval method to (accidentally) execute arbitrary code on the system through the CLI.
Attributes
Functions
|
Function that executes the eval function with a safer set of globals. |
Module Contents
- stable_learning_control.utils.safer_eval_util.safer_eval(*args, backend=None)[source]
Function that executes the eval function with a safer set of globals.
Note
This is done by setting the globals to a dictionary containing only modules we want the end user to access. This way, users can not use the eval method to (accidentally) execute arbitrary code on the system through the CLI.
- Parameters:
backend (str) – The machine learning backend you want to use. Options are
tf2
ortorch
. Defaults toNone
meaning no backend is assumed and both backends are tried.- Returns:
The eval return values.
- Return type:
args