code: def _reduce_embeddings(
      embedding: Representation, reducer, fit: bool = False
  ):
      embeddings_numpy = embedding(indices=None).detach().cpu().numpy()
      if embeddings_numpy.shape[1] == 2:
          logger.debug("not reducing entity embeddings, already dim=2")
          return embeddings_numpy, False
      elif fit:
          return reducer.fit_transform(embeddings_numpy), True
      else:
          return reducer.transform(embeddings_numpy), True
  
file_path: pykeen/src/pykeen/pipeline/plot_utils.py
imports: import logging
  from typing import Callable, Mapping, Optional, Set
  from ..losses import loss_resolver
  from ..models.nbase import ERModel
  from ..nn.representation import Representation
  from ..stoppers import EarlyStopper
label_desc: Use image node_id 6 for calling a global function with example usage: _reduce_embeddings(embedding, reducer, fit) and returns: embeddings_numpy,  False, reducer,  True, reducer,  True