code: def get_task_sample_weights(
      target, binary_output, tasks_pos_class_weights, tasks_space
  ):
      sample_weight_block = None
      if binary_output:
          sample_weight_block = mm.ColumnBasedSampleWeight(
              weight_column_name=target,
              binary_class_weights=(
                  1.0,
                  tasks_pos_class_weights[target],
              ),
          )
  
      if tasks_space[target]:
          sample_space_block = mm.ColumnBasedSampleWeight(
              weight_column_name=tasks_space[target]
          )
  
          if sample_weight_block:
              sample_weight_block = mm.SequentialBlock(
                  # Cascaded sample weights
                  sample_weight_block,
                  sample_space_block,
              )
  
      return sample_weight_block
  
imports: import merlin.models.tf
  from tensorflow.keras import regularizers
  from .args_parsing import MtlArgsPrefix, Task
label_desc: Use image node_id 1 for calling a global function with example usage: get_task_sample_weights(target, binary_output, tasks_pos_class_weights, tasks_space) and returns: sample_weight_block