# Path: ai_safety_gridworlds/demonstrations/demonstrations.py
# def get_demonstrations(environment):
#   def preprocess(demo):
# def environment_names():
# 
# Path: ai_safety_gridworlds/environments/shared/safety_ui.py
# FLAGS = flags.FLAGS
# class SafetyCursesUi(human_ui.CursesUi):
#   def __init__(self, *args, **kwargs):
#   def play(self, env):
#   def _init_curses_and_play(self, screen):
# def make_human_curses_ui(game_bg_colours, game_fg_colours, delay=100):
# def _format_timedelta(timedelta):
# 
# Path: ai_safety_gridworlds/helpers/factory.py
# def get_environment_obj(name, *args, **kwargs):


import importlib
import numpy as np
from absl import app
from absl import flags
from ai_safety_gridworlds.demonstrations import demonstrations
from ai_safety_gridworlds.environments.shared import safety_ui
from ai_safety_gridworlds.helpers import factory
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""Records a new demonstration using the commandline.

For example, in order to record in the safe_interruptibility environment, do

    $ record_demonstration.py --environment=safe_interruptibility

Note: if the environment doesn't terminate upon your action sequence, you can
use `quit` action to terminate it yourself and this will not be recorded in the
output sequence.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function






FLAGS = flags.FLAGS
flags.DEFINE_integer('seed', None, 'Random seed for the environment.')
flags.DEFINE_string('environment', None, 'Name of the environment.')
flags.mark_flag_as_required('environment')


def _postprocess_actions(actions_list):

# Path: ai_safety_gridworlds/demonstrations/demonstrations.py
# def get_demonstrations(environment):
#   def preprocess(demo):
# def environment_names():
# 
# Path: ai_safety_gridworlds/environments/shared/safety_ui.py
# FLAGS = flags.FLAGS
# class SafetyCursesUi(human_ui.CursesUi):
#   def __init__(self, *args, **kwargs):
#   def play(self, env):
#   def _init_curses_and_play(self, screen):
# def make_human_curses_ui(game_bg_colours, game_fg_colours, delay=100):
# def _format_timedelta(timedelta):
# 
# Path: ai_safety_gridworlds/helpers/factory.py
# def get_environment_obj(name, *args, **kwargs):


# Path: ai_safety_gridworlds/demonstrations/record_demonstration.py
import importlib
import numpy as np
from absl import app
from absl import flags
from ai_safety_gridworlds.demonstrations import demonstrations
from ai_safety_gridworlds.environments.shared import safety_ui
from ai_safety_gridworlds.helpers import factory

# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""Records a new demonstration using the commandline.

For example, in order to record in the safe_interruptibility environment, do

    $ record_demonstration.py --environment=safe_interruptibility

Note: if the environment doesn't terminate upon your action sequence, you can
use `quit` action to terminate it yourself and this will not be recorded in the
output sequence.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function






FLAGS = flags.FLAGS
flags.DEFINE_integer('seed', None, 'Random seed for the environment.')
flags.DEFINE_string('environment', None, 'Name of the environment.')
flags.mark_flag_as_required('environment')


def _postprocess_actions(actions_list):

  to_char = {a: c for c, a in demonstrations._actions.items()}  # pylint: disable=protected-access