code: def _blackbox_space(self, blackbox, system):
          
          tpm = marginalize_out(blackbox.hidden_indices, system.tpm)
  
          assert blackbox.output_indices == tpm_indices(tpm)
  
          tpm = remove_singleton_dimensions(tpm)
          n = len(blackbox)
          cm = np.zeros((n, n))
          for i, j in itertools.product(range(n), repeat=2):
              # TODO: don't pull cm from self
              outputs = self.blackbox.outputs_of(i)
              to = self.blackbox.partition[j]
              if self.cm[np.ix_(outputs, to)].sum() > 0:
                  cm[i, j] = 1
  
          state = blackbox.macro_state(system.state)
          node_indices = blackbox.macro_indices
  
          return SystemAttrs(tpm, cm, node_indices, state)
docs: Blackbox the TPM and CM in space.
  
          Conditions the TPM on the current value of the hidden nodes. The CM is
          set to universal connectivity.
  
          .. TODO: change this ^
  
          This shrinks the size of the TPM by the number of hidden indices; now
          there is only `len(output_indices)` dimensions in the TPM and in the
          state of the subsystem.