code: def create_h5py(
      data_dir,
      dataset,
      split,
      s_vocab=None,
      t_vocab=None,
      vocab_size=16384,
      time_steps=20,
  ):
      print("processing {} dataset - {}".format(dataset, split))
  
      if dataset == "europarl7":
          basename = "ep7_pc45"
          num_train = 900000
          num_valid = 2000
          max_sentence = 982178
      elif dataset == "un2000":
          basename = "un2000_pc34"
          num_train = 5200000
          num_valid = 2000
          max_sentence = 5259899
  
      sourcefile = basename + ".fr"
      targetfile = basename + ".en"
  
      # if h5 data file already exists, do not recreate
      path = os.path.join(data_dir, dataset)
      processed_file = os.path.join(path, dataset + "-" + split + ".h5")
      if os.path.exists(processed_file):
          print("{} already exists, skipping".format(processed_file))
          return None, None
  
      source = os.path.join(path, sourcefile)
      target = os.path.join(path, targetfile)
  
      if s_vocab is not None:
          vocab_size = len(s_vocab)
  
      # if vocab is not given, create from dataset
      s_vocab = (
          parse_vocab(source, vocab_size)
          if s_vocab is None
          else s_vocab
      )
      t_vocab = (
          parse_vocab(target, vocab_size)
          if t_vocab is None
          else t_vocab
      )
      s_token_to_index, s_index_to_token = vocab_to_dicts(s_vocab)
      t_token_to_index, t_index_to_token = vocab_to_dicts(t_vocab)
  
      # source sentence lengths
      lengths, s_num_short = get_lengths(
          source, split, time_steps, num_train, num_valid, max_sentence
      )
  
      # create data matrices
      X = create_data(
          source,
          time_steps,
          s_token_to_index,
          s_vocab,
          lengths,
          split,
          s_num_short,
          num_train,
          num_valid,
          max_sentence,
      )
      y = create_data(
          target,
          time_steps,
          t_token_to_index,
          t_vocab,
          lengths,
          split,
          s_num_short,
          num_train,
          num_valid,
          max_sentence,
      )
  
      # save parsed data
      print("Saving parsed data to {}".format(processed_file))
      with h5py.File(processed_file, "w") as f:
          f.create_dataset("s_vocab", data=s_vocab)
          f.create_dataset("t_vocab", data=t_vocab)
          f.create_dataset("X", data=X)
          f.create_dataset("y", data=y)
  
      return s_vocab, t_vocab
  
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 6 for calling a global function with example usage: create_h5py(data_dir, dataset, split, s_vocab, t_vocab, vocab_size, time_steps) and returns: s_vocab,  t_vocab, None,  None