code: def split(
      mapped_triples: MappedTriples,
      ratios: Union[float, Sequence[float]] = 0.8,
      random_state: TorchRandomHint = None,
      randomize_cleanup: bool = False,
      method: Optional[str] = None,
  ) -> Sequence[MappedTriples]:
      """Split triples into clean groups.
  
      :param mapped_triples: shape: (n, 3)
          The ID-based triples.
      :param ratios:
          There are three options for this argument.
          First, a float can be given between 0 and 1.0, non-inclusive. The first set of triples will get this ratio and
          the second will get the rest.
          Second, a list of ratios can be given for which set in which order should get what ratios as in ``[0.8, 0.1]``.
          The final ratio can be omitted because that can be calculated.
          Third, all ratios can be explicitly set in order such as in ``[0.8, 0.1, 0.1]`` where the sum of all ratios is
          1.0.
      :param random_state:
          The random state used to shuffle and split the triples.
      :param randomize_cleanup:
          If true, uses the non-deterministic method for moving triples to the training set. This has the advantage that
          it does not necessarily have to move all of them, but it might be significantly slower since it moves one
          triple at a time.
      :param method:
          The name of the method to use, cf. :data:`splitter_resolver`. Defaults to "coverage".
  
      :return:
          A partition of triples, which are split (approximately) according to the ratios.
  
      .. code-block:: python
  
          ratio = 0.8  # makes a [0.8, 0.2] split
          train, test = split(triples, ratio)
  
          ratios = [0.8, 0.1]  # makes a [0.8, 0.1, 0.1] split
          train, test, val = split(triples, ratios)
  
          ratios = [0.8, 0.1, 0.1]  # also makes a [0.8, 0.1, 0.1] split
          train, test, val = split(triples, ratios)
      """
      # backwards compatibility
      splitter_cls: Type[Splitter] = splitter_resolver.lookup(method)
      kwargs = dict()
      if splitter_cls is CleanupSplitter and randomize_cleanup:
          kwargs["cleaner"] = cleaner_resolver.normalize_cls(
              RandomizedCleaner
          )
      return splitter_resolver.make(
          splitter_cls, pos_kwargs=kwargs
      ).split(
          mapped_triples=mapped_triples,
          ratios=ratios,
          random_state=random_state,
      )
  
imports: import logging
  import typing
  from abc import abstractmethod
  from typing import Collection, Optional, Sequence, Set, Tuple, Type, Union
  import numpy
  import pandas
  import torch
  from class_resolver.api import ClassResolver, HintOrType
  from ..constants import COLUMN_LABELS
  from ..typing import LABEL_HEAD, LABEL_RELATION, LABEL_TAIL, MappedTriples, Target, TorchRandomHint
  from ..utils import ensure_torch_random_state
label_desc: Use image node_id 8 for calling a global function with example usage: split(mapped_triples, ratios, random_state, randomize_cleanup, method) and returns: splitter_resolver