code: def split_wikiner(
      directory,
      *in_filenames,
      encoding="utf-8",
      prefix="",
      suffix="bio",
      remap=None,
      shuffle=True,
      train_fraction=0.7,
      dev_fraction=0.15,
      test_section=True,
  ):
      sents = []
      for filename in in_filenames:
          new_sents = read_sentences(filename, encoding)
          print(f"{len(new_sents)} sentences read from {filename}.")
          sents.extend(new_sents)
  
      if remap:
          sents = remap_labels(sents, remap)
  
      # split
      num = len(sents)
      train_num = int(num * train_fraction)
      if test_section:
          dev_num = int(num * dev_fraction)
          if train_fraction + dev_fraction > 1.0:
              raise ValueError(
                  "Train and dev fractions added up to more than 1: {} {} {}".format(
                      train_fraction, dev_fraction
                  )
              )
      else:
          dev_num = num - train_num
  
      if shuffle:
          random.shuffle(sents)
      train_sents = sents[:train_num]
      dev_sents = sents[train_num : train_num + dev_num]
      if test_section:
          test_sents = sents[train_num + dev_num :]
          batches = [train_sents, dev_sents, test_sents]
          filenames = [
              f"train.{suffix}",
              f"dev.{suffix}",
              f"test.{suffix}",
          ]
      else:
          batches = [train_sents, dev_sents]
          filenames = [f"train.{suffix}", f"dev.{suffix}"]
  
      if prefix:
          filenames = ["%s.%s" % (prefix, f) for f in filenames]
      for batch, filename in zip(batches, filenames):
          write_sentences_to_file(
              batch, os.path.join(directory, filename)
          )
  
imports: import os
  import random
  from collections import Counter
label_desc: Use image node_id 4 for calling a global function with example usage: split_wikiner(directory) without return types