docs: def _blackbox_partial_noise(blackbox, system):
          """Noise connections from hidden elements to other boxes."""
          # Noise inputs from non-output elements hidden in other boxes
          node_tpms = []
          for node in system.nodes:
              node_tpm = node.tpm_on
              for input_node in node.inputs:
                  if blackbox.hidden_from(input_node, node.index):
                      node_tpm = marginalize_out([input_node], node_tpm)
  
              node_tpms.append(node_tpm)
  
          tpm = rebuild_system_tpm(node_tpms)
  
          return system._replace(tpm=tpm)