code: def actions(self, s):
          '''Possible actions from a state.'''
          # we try to generate every possible state and then filter those
          # states that are valid
          return [a for a in self._actions if self._is_valid(self.result(s, a))f actions(self, s):
          '''Possible actions from a state.'''
          # we try to generate every possible state and then filter those
          # states that are valid
          return [a for a in self._actions if self._is_valid(self.result(s, a))]
docs: Possible actions from a state.