<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ginga_to_matplotlib_cmap(cm, name=None):
 """Convert Ginga colormap to matplotlib's."""

    if name is None:
        name = cm.name
    from matplotlib.colors import ListedColormap
    carr = np.asarray(cm.clst)
    mpl_cm = ListedColormap(carr, name=name, N=len(carr))
    return mpl_cm