docstr: Maps triplet indices to the actual data in internal data store.
  Returns a numpy array of shape (3, batch_size, *self.X.shape[1]).
docstr_tok: ["Maps","triplet","indices","to","the","actual","data","in","internal","data","store",".","Returns","a","numpy","array","of","shape","(","3",",","batch_size",",","*","self.X.shape","[","1","]",")","."]
code: def get_triplet_data(self, triplet_indices):
      """Maps triplet indices to the actual data in internal data store.
      Returns a numpy array of shape (3, batch_size, *self.X.shape[1]).
      """
      if self.batched_data:
          # Flatten triplets, get batch of data, then reshape back into triplets
          indices = list(itertools.chain.from_iterable(triplet_indices))
          # Last batch may be smaller than defined so check real batch size
          batch_size = int(len(indices) / 3)
  
          data = self.X.get_batch(indices)
          triplet_batch = list(zip(*[iter(data)] * batch_size))
      else:
          if isinstance(self.X, np.ndarray):
              # Fancy index for speed if data is a numpy array
              triplet_indices = np.asarray(
                  triplet_indices, dtype=self._idx_dtype
              )
              triplet_batch = self.X[triplet_indices]
          else:
              triplet_batch = [
                  [self.X[idx] for idx in seq]
                  for seq in triplet_indices
              ]
  
      if issparse(self.X):
          triplet_batch = [
              [e.toarray()[0] for e in t] for t in triplet_batch
          ]
  
      triplet_batch = np.asarray(triplet_batch)
      return triplet_batch
  
imports: from abc import ABC, abstractmethod
  from functools import partial
  import itertools
  import random
  import math
  import numpy
  from tensorflow.keras.utils import Sequence
  from scipy.sparse import issparse
  from ..data import get_uint_ctype
label_desc: Use image node_id 7 for calling the TripletGenerator obj's underlying member method code with example usage: obj.get_triplet_data(triplet_indices) and returns: triplet_batch