code: def load_triples(
      path: Union[str, pathlib.Path, TextIO],
      delimiter: str = "\t",
      encoding: Optional[str] = None,
      column_remapping: Optional[Sequence[int]] = None,
  ) -> LabeledTriples:
      """Load triples saved as tab separated values.
  
      :param path: The key for the data to be loaded. Typically, this will be a file path ending in ``.tsv``
          that points to a file with three columns - the head, relation, and tail. This can also be used to
          invoke PyKEEN data importer entrypoints (see below).
      :param delimiter: The delimiter between the columns in the file
      :param encoding: The encoding for the file. Defaults to utf-8.
      :param column_remapping: A remapping if the three columns do not follow the order head-relation-tail.
          For example, if the order is head-tail-relation, pass ``(0, 2, 1)``
      :returns: A numpy array representing "labeled" triples.
  
      :raises ValueError: if a column remapping was passed but it was not a length 3 sequence
  
      Besides TSV handling, PyKEEN does not come with any importers pre-installed. A few can be found at:
  
      - :mod:`pybel.io.pykeen`
      - :mod:`bio2bel.io.pykeen`
      """
      if isinstance(path, (str, pathlib.Path)):
          path = str(path)
          for extension, handler in EXTENSION_IMPORTERS.items():
              if path.endswith(f".{extension}"):
                  return handler(path)
  
          for prefix, handler in PREFIX_IMPORTERS.items():
              if path.startswith(f"{prefix}:"):
                  return handler(path[len(f"{prefix}:") :])
  
      if encoding is None:
          encoding = "utf-8"
      if column_remapping is not None:
          if len(column_remapping) != 3:
              raise ValueError("remapping must have length of three")
      df = pandas.read_csv(
          path,
          sep=delimiter,
          encoding=encoding,
          dtype=str,
          header=None,
          usecols=column_remapping,
          keep_default_na=False,
      )
      if column_remapping is not None:
          df = df[[df.columns[c] for c in column_remapping]]
      return df.to_numpy()
  
file_path: pykeen/src/pykeen/triples/utils.py
imports: import pathlib
  from typing import Callable, List, Mapping, Optional, Sequence, Set, TextIO, Tuple, Union
  import numpy
  import pandas
  import torch
  from pkg_resources import iter_entry_points
  from ..typing import LabeledTriples, MappedTriples
label_desc: Use image node_id 2 for calling a global function with example usage: load_triples(path, delimiter, encoding, column_remapping) and returns: df, handler, handler