code: def split(
      table,
      path,
      train_prefix,
      validation_prefix,
      test_prefix,
      split_ratio=[0.6, 0.2, 0.2],
      stratified=False,
      strata_field="label",
  ):
      """Split a pandas dataframe or CSV file into train / validation / test data sets.
  
      Args:
          table (pandas.Dataframe or string): The pandas dataframe or CSV file to split.
          path (string): The directory to save the train, validation and test CSV files to.
          train: Suffix to add to `path` to get the training set save path.
          validation: Suffix to add to `path` to get the validation set save path.
          test: Suffix to add to `path` to get the test set save path.
          split_ratio (List of floats): a list of 3 numbers denoting the relative sizes of
              train, test and valid splits respectively. Default is [0.6, 0.2, 0.2].
          stratified (bool): whether the sampling should be stratified.
              Default is False.
          strata_field (str): name of the examples Field stratified over.
              Default is 'label' for the conventional label field.
      """
      assert len(split_ratio) == 3
  
      if not isinstance(table, pd.DataFrame):
          table = pd.read_csv(table)
      if table.index.name is not None:
          table = table.reset_index()
  
      examples = list(table.itertuples(index=False))
      fields = [(col, None) for col in list(table)]
      dataset = data.Dataset(examples, fields)
      train, valid, test = dataset.split(
          split_ratio, stratified, strata_field
      )
  
      tables = (
          pd.DataFrame(train.examples),
          pd.DataFrame(valid.examples),
          pd.DataFrame(test.examples),
      )
      prefixes = (train_prefix, validation_prefix, test_prefix)
  
      for i in range(len(tables)):
          tables[i].columns = table.columns
          tables[i].to_csv(os.path.join(path, prefixes[i]), index=False)
  
imports: from __future__ import division
  import copy
  import logging
  import os
  import pdb
  from collections import Counter, defaultdict
  from timeit import default_timer
  import pandas
  import pyprind
  import six
  from sklearn.decomposition import TruncatedSVD
  import torch
  import torch.nn
  from torchtext.legacy import data
  from torchtext.legacy.data.example import Example
  from torchtext.utils import unicode_csv_reader
  from ..models.modules import NoMeta, Pool
  from .field import MatchingField
  from .iterator import MatchingIterator
label_desc: Use image node_id 1 for calling a global function with example usage: split(table, path, train_prefix, validation_prefix, test_prefix, split_ratio, stratified, strata_field) without return types