<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def blackbox(blackbox):
 """Validate a macro blackboxing."""

    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))