code: def init_transform(indices, weights, embedding):
      
      result = np.zeros((indices.shape[0], embedding.shape[1]), dtype=np.float32)
  
      for i in range(indices.shape[0]):
          for j in range(indices.shape[1]):
              for d in range(embedding.shape[1]):
                  result[i, d] += weights[i, j] * embedding[indices[i, j], d]
  
      return result
docs: Given indices and weights and an original embeddings
      initialize the positions of new points relative to the
      indices and weights (of their neighbors in the source data).
  
      Parameters
      ----------
      indices: array of shape (n_new_samples, n_neighbors)
          The indices of the neighbors of each new sample
  
      weights: array of shape (n_new_samples, n_neighbors)
          The membership strengths of associated 1-simplices
          for each of the new samples.
  
      embedding: array of shape (n_samples, dim)
          The original embedding of the source data.
  
      Returns
      -------
      new_embedding: array of shape (n_new_samples, dim)
          An initial embedding of the new sample points.