def math_to_image(s, filename_or_obj, prop=None, dpi=None, format=None):
    from matplotlib import figure
    # backend_agg supports all of the core output formats
    from matplotlib.backends import backend_agg
    from matplotlib.font_manager import FontProperties
    from matplotlib.mathtext import MathTextParser

    if prop is None:
        prop = FontProperties()

    parser = MathTextParser('path')
    width, height, depth, _, _ = parser.parse(s, dpi=72, prop=prop)

    fig = figure.Figure(figsize=(width / 72.0, height / 72.0))
    fig.text(0, depth/height, s, fontproperties=prop)
    backend_agg.FigureCanvasAgg(fig)
    fig.savefig(filename_or_obj, dpi=dpi, format=format)

    return depth
Call HealthVault and get a session token, returning it.
dataset/ETHPy150Open ipython/ipython-py3k/IPython/lib/latextools.py/math_to_image--crossover with--dataset/ETHPy150Open orcasgit/python-healthvault/healthvaultlib/healthvault.py/HealthVaultConn._get_auth_token