code: def arrays_to_sequences(token_list_iterable, sequence_length=2049):
      """
      Given token arrays of arbitrary lengths, concats/splits them into arrays of equal length
  
      Returns equal-length token arrays, followed by a a final array of trailing tokens (which may be shorter)
      """
      accum = []
      for l in token_list_iterable:
          accum.extend(l)
  
          if len(accum) > sequence_length:
              chunks = split_list(accum, sequence_length)
              yield from chunks[:-1]
              accum = chunks[-1]
  
      if len(accum) > 0:
          yield accum
  
imports: import argparse
  import os
  import re
  import random
  from pathlib import Path
  from typing import List
  import ftfy
  import tensorflow
  from lm_dataformat import Reader
  from transformers import GPT2TokenizerFast
  from tqdm import tqdm
label_desc: Use image node_id 13 for calling a global function with example usage: arrays_to_sequences(token_list_iterable, sequence_length) without return types