code: def ref_pack_padded_sequence(padded_sequence, lengths, batch_first):
      batch_sizes = compute_batch_sizes(lengths)
      packed_sequence = []
      for t, batch_size in enumerate(batch_sizes):
          if batch_first:
              packed_sequence_t = padded_sequence[:batch_size, t]
          else:
              packed_sequence_t = padded_sequence[t, :batch_size]
          packed_sequence.append(packed_sequence_t)
      packed_sequence = np.concatenate(packed_sequence, 0)
      return packed_sequence, batch_sizes
  
file_path: nnabla/python/test/function/test_pack_padded_sequence.py
imports: import pytest
  import numpy
  import nnabla.functions
  from nbla_test_utils import list_context
  from refs import pad_sequence
label_desc: Use image node_id 2 for calling a global function with example usage: ref_pack_padded_sequence(padded_sequence, lengths, batch_first) and returns: packed_sequence,  batch_sizes