class_docstr: Base class for training instances.
class_docstr_tok: ["Base","class","for","training","instances","."]
docstr: Create instances from mapped triples.
  
  :param mapped_triples: shape: (num_triples, 3)
      The ID-based triples.
  :param num_entities: >0
      The number of entities.
  :param num_relations: >0
      The number of relations.
  :param kwargs:
      additional keyword-based parameters.
  
  :return:
      The instances.
  
  # noqa:DAR202
  # noqa:DAR401
docstr_tok: ["Create","instances","from","mapped","triples",".",":","param","mapped_triples",":","shape",":","(","num_triples",",","3",")","The","ID-based","triples",".",":","param","num_entities",":",">","0","The","number","of","entities",".",":","param","num_relations",":",">","0","The","number","of","relations",".",":","param","kwargs",":","additional","keyword-based","parameters",".",":","return",":","The","instances",".","#","noqa",":","DAR202","#","noqa",":","DAR401"]
code: def from_triples(
      cls,
      mapped_triples: MappedTriples,
      *,
      num_entities: int,
      num_relations: int,
      **kwargs,
  ) -> "Instances":
      """Create instances from mapped triples.
  
      :param mapped_triples: shape: (num_triples, 3)
          The ID-based triples.
      :param num_entities: >0
          The number of entities.
      :param num_relations: >0
          The number of relations.
      :param kwargs:
          additional keyword-based parameters.
  
      :return:
          The instances.
  
      # noqa:DAR202
      # noqa:DAR401
      """
      raise NotImplementedError
  
imports: import math
  from abc import ABC, abstractmethod
  from typing import Callable, Generic, Iterable, Iterator, List, NamedTuple, Optional, Tuple, TypeVar
  import numpy
  import scipy.sparse
  import torch
  from class_resolver import HintOrType, OptionalKwargs
  from torch.utils import data
  from .utils import compute_compressed_adjacency_list
  from ..sampling import NegativeSampler, negative_sampler_resolver
  from ..typing import MappedTriples
label_desc: Use image node_id 3 for calling the Instances obj's underlying member method code with example usage: obj.from_triples(cls, mapped_triples) without return types