def repr_spark_context_html(sc):
    """
    Carry over from the Spark 2.2.0 _repr_html_ for spark contexts

    Works on objects whose fully qualified name is 'pyspark.context.SparkContext'
    """
    return (
        """
    <div>
        <p><b>SparkContext</b></p>

        <p><a href="{sc.uiWebUrl}">Spark UI</a></p>

        <dl>
          <dt>Version</dt>
            <dd><code>v{sc.version}</code></dd>
          <dt>Master</dt>
            <dd><code>{sc.master}</code></dd>
          <dt>AppName</dt>
            <dd><code>{sc.appName}</code></dd>
        </dl>
    </div>
    """
        .format(sc=sc))
