code: def pad_2d_vals(in_vals, dim1_size, dim2_size, dtype=np.int32):
      out_val = np.zeros((dim1_size, dim2_size), dtype=dtype)
      if dim1_size > len(in_vals):
          dim1_size = len(in_vals)
      for i in range(dim1_size):
          cur_in_vals = in_vals[i]
          cur_dim2_size = dim2_size
          if cur_dim2_size > len(cur_in_vals):
              cur_dim2_size = len(cur_in_vals)
          out_val[i, :cur_dim2_size] = cur_in_vals[:cur_dim2_size]
      return out_val
  
imports: import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: pad_2d_vals(in_vals, dim1_size, dim2_size, dtype) and returns: out_val