<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def diffusion_mds(means, weights, d, diffusion_rounds=10):
 """ Dimensionality reduction using MDS, while running diffusion on W. Args: means (array):
 genes x clusters weights (array):
 clusters x cells d (int):
 desired dimensionality Returns: W_reduced (array):
 array of shape (d, cells) """

    for i in range(diffusion_rounds):
        weights = weights*weights
        weights = weights/weights.sum(0)
    X = dim_reduce(means, weights, d)
    if X.shape[0]==2:
        return X.dot(weights)
    else:
        return X.T.dot(weights)