def METHOD_NAME(
    commands: List[List[ICommand]],
    data: Union[FileStudy, FileStudyTreeConfig],
    applier: APPLY_CALLBACK,
    metadata: Optional[VariantStudy] = None,
    notifier: Optional[Callable[[int, bool, str], None]] = None,
) -> GenerationResultInfoDTO:
    stopwatch = StopWatch()
    # Apply commands
    results: GenerationResultInfoDTO = GenerationResultInfoDTO(success=True, details=[])
    stopwatch.reset_current()
    logger.info("Applying commands")
    command_index = 0
    total_commands = len(commands)
    study_id = metadata.id if metadata is not None else "-"
    for command_batch in commands:
        command_output_status = True
        command_output_message = ""
        command_name = command_batch[0].command_name.value if len(command_batch) > 0 else ""
        try:
            command_index += 1
            command_output_messages: List[str] = []
            for command in command_batch:
                output = applier(command, data)
                command_output_messages.append(output.message)
                command_output_status = command_output_status and output.status
                if not command_output_status:
                    break
            command_output_message = "\n".join(command_output_messages)
        except Exception as e:
            command_output_status = False
            command_output_message = f"Error while applying command {command_name}"
            logger.error(command_output_message, exc_info=e)
            break
        finally:
            results.details.append(
                (
                    command_name,
                    command_output_status,
                    command_output_message,
                )
            )
            results.success = command_output_status
            if notifier:
                notifier(
                    command_index - 1,
                    command_output_status,
                    command_output_message,
                )
            stopwatch.log_elapsed(
                lambda x: logger.info(
                    f"Command {command_index}/{total_commands} [{study_id}] {command.match_signature()} applied in {x}s"
                )
            )
        if not results.success:
            break
    data_type = isinstance(data, FileStudy)
    stopwatch.log_elapsed(
        lambda x: logger.info(
            f"Variant generation done in {x}s" if data_type else f"Variant light generation done in {x}s"
        ),
        since_start=True,
    )
    return results