code: def get_lengths(
      path, split, time_steps, num_train, num_valid, max_sentence
  ):
      with open(path, "r") as f:
          lengths = []
          num_short = 0
          for ii, sentence in enumerate(f):
              if (split is "train" and ii < num_train) or (
                  split is "valid" and ii >= max_sentence - num_valid
              ):
                  tokens = sentence.split()
                  lengths.append(len(tokens))
                  if lengths[-1] <= time_steps:
                      num_short += 1
      return lengths, num_short
  
file_path: neon/examples/nmt/data.py
imports: import os
  import numpy
  from collections import Counter
  import h5py
  import tarfile
  import gzip
  from neon.data.datasets import Dataset
  from neon.util.argparser import NeonArgparser
label_desc: Use image node_id 4 for calling a global function with example usage: get_lengths(path, split, time_steps, num_train, num_valid, max_sentence) and returns: lengths,  num_short