code: def blackbox(blackbox):
      
      if tuple(sorted(blackbox.output_indices)) != blackbox.output_indices:
          raise ValueError('Output indices {} must be ordered'.format(
              blackbox.output_indices))
  
      partition(blackbox.partition)
  
      for part in blackbox.partition:
          if not set(part) & set(blackbox.output_indices):
              raise ValueError(
                  'Every blackbox must have an output - {} does not'.format(
                      part))
docs: Validate a macro blackboxing.