code: def flatten_sequences_time_first(sequences):
      """Flatten sequences with time axis first.
  
      The resulting order is the same as how
      `torch.nn.utils.rnn.pack_sequence` will pack sequences into a tensor.
  
      Args:
          sequences: Sequences with batch axis first.
  
      Returns:
          list: Flattened sequences with time axis first.
      """
      ret = []
      for batch in itertools.zip_longest(*sequences):
          ret.extend([x for x in batch if x is not None])
      return ret
  
file_path: pfrl/pfrl/utils/recurrent.py
imports: import itertools
  import numpy
  import torch
  from torch import nn
label_desc: Use image node_id 9 for calling a global function with example usage: flatten_sequences_time_first(sequences) and returns: ret