code: def state_probability(self, direction, repertoire, purview,):
          
          purview_state = self.purview_state(direction)
  
          index = tuple(node_state if node in purview else 0
                        for node, node_state in enumerate(purview_state))
          return repertoire[index]
docs: Compute the probability of the purview in its current state given
          the repertoire.
  
          Collapses the dimensions of the repertoire that correspond to the
          purview nodes onto their state. All other dimension are already
          singular and thus receive 0 as the conditioning index.
  
          Returns:
              float: A single probabilty.