code: def _limit_sequence_length(sequences, max_len):
      assert max_len > 0
      new_sequences = []
      for sequence in sequences:
          while len(sequence) > max_len:
              new_sequences.append(sequence[:max_len])
              sequence = sequence[max_len:]
          assert 0 < len(sequence) <= max_len
          new_sequences.append(sequence)
      return new_sequences
  
imports: import collections
  import itertools
  import random
  import chainer
  from chainer import cuda
  import chainer.functions
  import numpy
  from chainerrl import agent
  from chainerrl.misc.batch_states import batch_states
label_desc: Use image node_id 7 for calling a global function with example usage: _limit_sequence_length(sequences, max_len) and returns: new_sequences