<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_mpl(fig, savefig_kw=None):
 """Create a SVG figure from a ``matplotlib`` figure. Parameters fig : matplotlib.Figure instance savefig_kw : dict keyword arguments to be passed to matplotlib's `savefig` Returns ------- SVGFigure newly created :py:class:`SVGFigure` initialised with the string content. Examples -------- If you want to overlay the figure on another SVG, you may want to pass the `transparent` option: """


    fid = StringIO()
    if savefig_kw is None:
        savefig_kw = {}

    try:
        fig.savefig(fid, format='svg', **savefig_kw)
    except ValueError:
        raise(ValueError, "No matplotlib SVG backend")
    fid.seek(0)
    fig = fromstring(fid.read())

    # workaround mpl units bug
    w, h = fig.get_size()
    fig.set_size((w.replace('pt', ''), h.replace('pt', '')))

    return fig