code: def after_padding(args):
      """
      attention mask:
      ***  src,  tgt, attn
      src  00,   01,   11
      tgt  10,   11,   12
      attn 20,   21,   22
  
      ***   s1, s2 | t1 t2 t3| attn1 attn2 attn3
      s1    1,  1  | 0, 0, 0,| 0,    0,    0,
      s2    1,  1  | 0, 0, 0,| 0,    0,    0,
      -
      t1    1,  1, | 1, 0, 0,| 0,    0,    0,
      t2    1,  1, | 1, 1, 0,| 0,    0,    0,
      t3    1,  1, | 1, 1, 1,| 0,    0,    0,
      -
      attn1 1,  1, | 0, 0, 0,| 1,    0,    0,
      attn2 1,  1, | 1, 0, 0,| 0,    1,    0,
      attn3 1,  1, | 1, 1, 0,| 0,    0,    1,
  
      for details, see Fig3. https://arxiv.org/abs/2001.11314
      """
      (
          src_ids,
          src_pids,
          src_sids,
          tgt_ids,
          tgt_pids,
          tgt_sids,
          attn_ids,
          tgt_labels,
      ) = args
      src_len = src_ids.shape[1]
      tgt_len = tgt_ids.shape[1]
      mask_00 = gen_mask(src_ids, "bidi", query_len=src_len)
      mask_01 = gen_mask(tgt_ids, "empty", query_len=src_len)
      mask_02 = gen_mask(attn_ids, "empty", query_len=src_len)
  
      mask_10 = gen_mask(src_ids, "bidi", query_len=tgt_len)
      mask_11 = gen_mask(tgt_ids, "causal", query_len=tgt_len)
      mask_12 = gen_mask(attn_ids, "empty", query_len=tgt_len)
  
      mask_20 = gen_mask(src_ids, "bidi", query_len=tgt_len)
      mask_21 = gen_mask(
          tgt_ids, "causal_without_diag", query_len=tgt_len
      )
      mask_22 = gen_mask(attn_ids, "diag", query_len=tgt_len)
  
      mask_src_2_src = mask_00
      mask_tgt_2_srctgt = np.concatenate([mask_10, mask_11], 2)
      mask_attn_2_srctgtattn = np.concatenate(
          [mask_20, mask_21, mask_22], 2
      )
  
      raw_tgt_labels = deepcopy(tgt_labels)
      tgt_labels = tgt_labels[np.where(tgt_labels != 0)]
      return (
          src_ids,
          src_sids,
          src_pids,
          tgt_ids,
          tgt_sids,
          tgt_pids,
          attn_ids,
          mask_src_2_src,
          mask_tgt_2_srctgt,
          mask_attn_2_srctgtattn,
          tgt_labels,
          raw_tgt_labels,
      )
  
imports: from copy import deepcopy
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: after_padding(args) and returns: src_ids,  src_sids,  src_pids,  tgt_ids,  tgt_sids,  tgt_pids,  attn_ids,  mask_src_2_src,  mask_tgt_2_srctgt,  mask_attn_2_srctgtattn,  tgt_labels,  raw_tgt_labels