code: def get_mtl_prediction_tasks(targets, args):
      task_block = None
      if args.use_task_towers:
          task_block = mm.MLPBlock(
              args.tower_layers,
              activation=args.activation,
              kernel_initializer=args.mlp_init,
              dropout=args.dropout,
              kernel_regularizer=regularizers.l2(args.l2_reg),
              bias_regularizer=regularizers.l2(args.l2_reg),
          )
  
      tasks_pos_class_weights = get_mtl_positive_class_weights(
          targets, args
      )
  
      if args.tasks_sample_space:
          if len(args.tasks) != len(args.tasks_sample_space):
              raise ValueError(
                  "If --tasks_sample_space is provided, the list of tasks sample "
                  "(separated by ',') need to match the length of the list "
                  "of --tasks ('all' is not allowed in this case. "
                  "If the sample space of a target is the whole dataset "
                  "then you can use empty string ('') for that task. "
                  "For example: --tasks=click,like --tasks_sample_space=,click"
              )
          tasks_space = dict(zip(args.tasks, args.tasks_sample_space))
      else:
          tasks_space = {t: None for t in args.tasks}
  
      prediction_tasks = []
      if Task.BINARY_CLASSIFICATION.value in targets:
          prediction_tasks.extend(
              [
                  mm.BinaryOutput(
                      target,
                      post=get_task_sample_weights(
                          target,
                          True,
                          tasks_pos_class_weights,
                          tasks_space,
                      ),
                      # Cloning task tower
                      pre=task_block.from_config(
                          task_block.get_config()
                      )
                      if task_block
                      else None,
                  )
                  for target in targets[
                      Task.BINARY_CLASSIFICATION.value
                  ]
              ]
          )
  
      if Task.REGRESSION.value in targets:
          prediction_tasks.extend(
              [
                  mm.RegressionOutput(
                      target,
                      post=get_task_sample_weights(
                          target,
                          False,
                          tasks_pos_class_weights,
                          tasks_space,
                      ),
                      # Cloning task tower
                      pre=task_block.from_config(
                          task_block.get_config()
                      )
                      if task_block
                      else None,
                  )
                  for target in targets[Task.REGRESSION.value]
              ]
          )
  
      prediction_tasks = mm.ParallelBlock(*prediction_tasks)
      return prediction_tasks
  
imports: import merlin.models.tf
  from tensorflow.keras import regularizers
  from .args_parsing import MtlArgsPrefix, Task
label_desc: Use image node_id 4 for calling a global function with example usage: get_mtl_prediction_tasks(targets, args) and returns: prediction_tasks