code: def get_datasets(
      fnames,
      min_freq=-1,
      sep=";",
      joint_vocab=True,
      device=None,
      save="tmp.pickle",
  ):
      # min_freq : not support now since it's very sensitive to the final results, but you can set it via passing min_freq to the Vocab class.
      # sep : not support now
      # joint_vocab : not support now
      ent_vocab = Vocab(sp=["<PAD>", "<UNK>"])
      title_vocab = Vocab(min_freq=5)
      rel_vocab = Vocab(sp=["<PAD>", "<UNK>"])
      text_vocab = Vocab(min_freq=5)
      ent_text_vocab = Vocab(sp=["<PAD>", "<UNK>"])
      datasets = []
      for fname in fnames:
          exs = []
          json_datas = json.loads(open(fname).read())
          for json_data in json_datas:
              # construct one data example
              ex = Example.from_json(json_data)
              if fname == fnames[0]:  # only training set
                  ex.update_vocab(
                      ent_vocab,
                      rel_vocab,
                      text_vocab,
                      ent_text_vocab,
                      title_vocab,
                  )
              exs.append(ex)
          datasets.append(exs)
      ent_vocab.build()
      rel_vocab.build()
      text_vocab.build()
      ent_text_vocab.build()
      title_vocab.build()
      datasets = [
          GWdataset(
              exs,
              ent_vocab,
              rel_vocab,
              text_vocab,
              ent_text_vocab,
              title_vocab,
              device,
          )
          for exs in datasets
      ]
      with open(save, "wb") as f:
          pickle.dump(datasets, f)
      return datasets
  
imports: import json
  import pickle
  import random
  import dgl
  import numpy
  import torch
label_desc: Use image node_id 6 for calling a global function with example usage: get_datasets(fnames, min_freq, sep, joint_vocab, device, save) and returns: datasets