code: def transitions(network, before_state, after_state):
      
      # TODO: Does not return subsystems that are in an impossible transitions.
  
      # Elements without inputs are reducibe effects,
      # elements without outputs are reducible causes.
      possible_causes = np.where(np.sum(network.cm, 1) > 0)[0]
      possible_effects = np.where(np.sum(network.cm, 0) > 0)[0]
  
      for cause_subset in utils.powerset(possible_causes, nonempty=True):
          for effect_subset in utils.powerset(possible_effects, nonempty=True):
              try:
                  yield Transition(network, before_state, after_state,
                                   cause_subset, effect_subset)
              except exceptions.StateUnreachableError:
                  pass
docs: Return a generator of all **possible** transitions of a network.