code: def mds(means, weights, d):
      
      X = dim_reduce(means, weights, d)
      if X.shape[0]==2:
          return X.dot(weights)
      else:
          return X.T.dot(weights)
docs: Dimensionality reduction using MDS.
  
      Args:
          means (array): genes x clusters
          weights (array): clusters x cells
          d (int): desired dimensionality
  
      Returns:
          W_reduced (array): array of shape (d, cells)