def __init__(self, env,
                 update_interval=10,
                 average_over=10,
                 extra_rows=None):
        """
        Args:
            update_interval: print every N episodes
            average_over: average rewards/speed over the last N episodes
            extra_rows: an OrderedDict {'row caption': function(total_steps, num_episodes)}
                to generate extra rows to the printed table.
        """
        super().__init__(env)
        self._periodic = PeriodicTracker(update_interval)
        self._avg = average_over
        if extra_rows is None:
            self._extra_rows = OrderedDict()
        else:
            assert isinstance(extra_rows, OrderedDict), \
                'extra_rows spec {"row caption": function(total_steps, ' \
                'num_episodes)} must be an OrderedDict'
            self._extra_rows = extra_rows

        Args:
            update_interval: print every N episodes
            average_over: average rewards/speed over the last N episodes
            extra_rows: an OrderedDict {'row caption': function(total_steps, num_episodes)}
                to generate extra rows to the printed table.
        
surreal/env/monitor.py