code: def _remove_action_from_type(valid_actions: Dict[str, List[str]],
                                   type_: str,
                                   filter_function: Callable[[str], bool]) -> None:
          
          action_list = valid_actions[type_]
          matching_action_index = [i for i, action in enumerate(action_list) if filter_function(action)]
          assert len(matching_action_index) == 1, "Filter function didn't find one action"
          action_list.pop(matching_action_index[0])
docs: Finds the production rule matching the filter function in the given type's valid action
          list, and removes it.  If there is more than one matching function, we crash.