code: def random_shuffle_files(
      input_dir, input_files, output_dir, short_name
  ):
      """
      Shuffle the files into different chunks based on their filename
  
      The first piece of the filename, split by ".", is used as a random seed.
  
      This will make it so that adding new files or using a different
      annotation scheme (assuming that's encoding in pieces of the
      filename) won't change the distibution of the files
      """
      input_keys = {}
      for f in input_files:
          seed = f.split(".")[0]
          if seed in input_keys:
              raise ValueError(
                  "Multiple files with the same prefix: %s and %s"
                  % (input_keys[seed], f)
              )
          input_keys[seed] = f
      assert len(input_keys) == len(input_files)
  
      train_files = []
      dev_files = []
      test_files = []
  
      for filename in input_files:
          seed = filename.split(".")[0]
          # "salt" the filenames when using as a seed
          # definitely not because of a dumb bug in the original implementation
          seed = seed + ".txt.4class.tsv"
          random.seed(seed, 2)
          location = random.random()
          if location < 0.7:
              train_files.append(filename)
          elif location < 0.8:
              dev_files.append(filename)
          else:
              test_files.append(filename)
  
      print(
          "Train files: %d  Dev files: %d  Test files: %d"
          % (len(train_files), len(dev_files), len(test_files))
      )
      assert len(train_files) + len(dev_files) + len(test_files) == len(
          input_files
      )
  
      file_lists = [train_files, dev_files, test_files]
      datasets = []
      for files in file_lists:
          dataset = []
          for filename in files:
              dataset.extend(
                  read_tsv(os.path.join(input_dir, filename), 0, 1)
              )
          datasets.append(dataset)
  
      write_dataset(datasets, output_dir, short_name)
      return len(train_files), len(dev_files), len(test_files)
  
imports: from collections import defaultdict
  import json
  import os
  import random
  from stanza.models.common.doc import Document
  import stanza.utils.datasets.ner.prepare_ner_file
label_desc: Use image node_id 9 for calling a global function with example usage: random_shuffle_files(input_dir, input_files, output_dir, short_name) and returns: len,  len,  len