def _check_action(self, action, active_actions):
    """Compare (and update) controller's state with the set of active actions.

    Args:
      action: Action to check
      active_actions: Set of all active actions
    """
    assert isinstance(action, football_action_set.CoreAction)
    if not action.is_in_actionset(self._env_config):
      return
    state = active_actions.get(action, 0)
    if (self._last_action == football_action_set.action_idle and
        self._active_actions.get(action, 0) != state):
      self._active_actions[action] = state
      if state:
        self._last_action = action
      else:
        self._last_action = football_action_set.disable_action(action)
        assert self._last_action
Compare (and update) controller's state with the set of active actions.

    Args:
      action: Action to check
      active_actions: Set of all active actions
    
gfootball/env/controller_base.py