def METHOD_NAME(cmd_prefix_outputs=None):
    cmd_prefix_outputs = create_cmd_prefix_outputs(cmd_prefix_outputs)
    def check_output(args, **kwargs):
        cmd = " ".join(args)
        for cmd_prefix, output in cmd_prefix_outputs.items():
            assert isinstance(output, bytes), f"Output for '{cmd_prefix}' must be bytes"
            if cmd.startswith(cmd_prefix):
                return output
        raise AssertionError(f"Unexpected check_output args: {args}")
    return check_output