<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Demo-of-RISE-for-slides-with-Jupyter-notebooks-(Python)" data-toc-modified-id="Demo-of-RISE-for-slides-with-Jupyter-notebooks-(Python)-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Demo of RISE for slides with Jupyter notebooks (Python)</a></span><ul class="toc-item"><li><span><a href="#Title-2" data-toc-modified-id="Title-2-1.1"><span class="toc-item-num">1.1&nbsp;&nbsp;</span>Title 2</a></span><ul class="toc-item"><li><span><a href="#Title-3" data-toc-modified-id="Title-3-1.1.1"><span class="toc-item-num">1.1.1&nbsp;&nbsp;</span>Title 3</a></span><ul class="toc-item"><li><span><a href="#Title-4" data-toc-modified-id="Title-4-1.1.1.1"><span class="toc-item-num">1.1.1.1&nbsp;&nbsp;</span>Title 4</a></span></li></ul></li></ul></li><li><span><a href="#Text" data-toc-modified-id="Text-1.2"><span class="toc-item-num">1.2&nbsp;&nbsp;</span>Text</a></span></li><li><span><a href="#Maths" data-toc-modified-id="Maths-1.3"><span class="toc-item-num">1.3&nbsp;&nbsp;</span>Maths</a></span></li><li><span><a href="#And-code" data-toc-modified-id="And-code-1.4"><span class="toc-item-num">1.4&nbsp;&nbsp;</span>And code</a></span></li></ul></li><li><span><a href="#More-demo-of-Markdown-code" data-toc-modified-id="More-demo-of-Markdown-code-2"><span class="toc-item-num">2&nbsp;&nbsp;</span>More demo of Markdown code</a></span><ul class="toc-item"><li><span><a href="#Lists" data-toc-modified-id="Lists-2.1"><span class="toc-item-num">2.1&nbsp;&nbsp;</span>Lists</a></span><ul class="toc-item"><li><ul class="toc-item"><li><span><a href="#Images" data-toc-modified-id="Images-2.1.0.1"><span class="toc-item-num">2.1.0.1&nbsp;&nbsp;</span>Images</a></span></li><li><span><a href="#And-Markdown-can-include-raw-HTML" data-toc-modified-id="And-Markdown-can-include-raw-HTML-2.1.0.2"><span class="toc-item-num">2.1.0.2&nbsp;&nbsp;</span>And Markdown can include raw HTML</a></span></li></ul></li></ul></li></ul></li><li><span><a href="#End-of-this-demo" data-toc-modified-id="End-of-this-demo-3"><span class="toc-item-num">3&nbsp;&nbsp;</span>End of this demo</a></span></li></ul></div>
Demo of RISE for slides with Jupyter notebooks (Python)
This document is an example of a slideshow, written in a Jupyter notebook with the RISE extension.
By Lilian Besson, Sept.2017.
Title 2
Title 3
Title 4
Title 5
Title 6
Text
With text, emphasis, bold, ~~striked~~, inline code and
Quote.
-- By a guy.
Maths
With inline math $\sin(x)^2 + \cos(x)^2 = 1$ and equations
Step5:  More demo of Markdown code
Lists
Unordered
lists
are easy.
And
and ordered also ! Just
start lines by 1., 2. etc
or simply 1., 1., ...
Images
With a HTML &lt;img/&gt; tag or the ![alt](url) Markdown code
Step6:  And Markdown can include raw HTML
<center><span style="color
<ASSISTANT_TASK:>
Python Code:
from sys import version
print(version)
Explanation: <h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Demo-of-RISE-for-slides-with-Jupyter-notebooks-(Python)" data-toc-modified-id="Demo-of-RISE-for-slides-with-Jupyter-notebooks-(Python)-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Demo of RISE for slides with Jupyter notebooks (Python)</a></span><ul class="toc-item"><li><span><a href="#Title-2" data-toc-modified-id="Title-2-1.1"><span class="toc-item-num">1.1&nbsp;&nbsp;</span>Title 2</a></span><ul class="toc-item"><li><span><a href="#Title-3" data-toc-modified-id="Title-3-1.1.1"><span class="toc-item-num">1.1.1&nbsp;&nbsp;</span>Title 3</a></span><ul class="toc-item"><li><span><a href="#Title-4" data-toc-modified-id="Title-4-1.1.1.1"><span class="toc-item-num">1.1.1.1&nbsp;&nbsp;</span>Title 4</a></span></li></ul></li></ul></li><li><span><a href="#Text" data-toc-modified-id="Text-1.2"><span class="toc-item-num">1.2&nbsp;&nbsp;</span>Text</a></span></li><li><span><a href="#Maths" data-toc-modified-id="Maths-1.3"><span class="toc-item-num">1.3&nbsp;&nbsp;</span>Maths</a></span></li><li><span><a href="#And-code" data-toc-modified-id="And-code-1.4"><span class="toc-item-num">1.4&nbsp;&nbsp;</span>And code</a></span></li></ul></li><li><span><a href="#More-demo-of-Markdown-code" data-toc-modified-id="More-demo-of-Markdown-code-2"><span class="toc-item-num">2&nbsp;&nbsp;</span>More demo of Markdown code</a></span><ul class="toc-item"><li><span><a href="#Lists" data-toc-modified-id="Lists-2.1"><span class="toc-item-num">2.1&nbsp;&nbsp;</span>Lists</a></span><ul class="toc-item"><li><ul class="toc-item"><li><span><a href="#Images" data-toc-modified-id="Images-2.1.0.1"><span class="toc-item-num">2.1.0.1&nbsp;&nbsp;</span>Images</a></span></li><li><span><a href="#And-Markdown-can-include-raw-HTML" data-toc-modified-id="And-Markdown-can-include-raw-HTML-2.1.0.2"><span class="toc-item-num">2.1.0.2&nbsp;&nbsp;</span>And Markdown can include raw HTML</a></span></li></ul></li></ul></li></ul></li><li><span><a href="#End-of-this-demo" data-toc-modified-id="End-of-this-demo-3"><span class="toc-item-num">3&nbsp;&nbsp;</span>End of this demo</a></span></li></ul></div>
Demo of RISE for slides with Jupyter notebooks (Python)
This document is an example of a slideshow, written in a Jupyter notebook with the RISE extension.
By Lilian Besson, Sept.2017.
Title 2
Title 3
Title 4
Title 5
Title 6
Text
With text, emphasis, bold, ~~striked~~, inline code and
Quote.
-- By a guy.
Maths
With inline math $\sin(x)^2 + \cos(x)^2 = 1$ and equations:
$$\sin(x)^2 + \cos(x)^2 = \left(\frac{\mathrm{e}^{ix} - \mathrm{e}^{-ix}}{2i}\right)^2 + \left(\frac{\mathrm{e}^{ix} + \mathrm{e}^{-ix}}{2}\right)^2 = \frac{-\mathrm{e}^{2ix}-\mathrm{e}^{-2ix}+2 \; ++\mathrm{e}^{2ix}+\mathrm{e}^{-2ix}+2}{4} = 1.$$
And code
In Markdown:
python
from sys import version
print(version)
And in a executable cell (with Python 3 kernel) :
End of explanation
# https://gist.github.com/dm-wyncode/55823165c104717ca49863fc526d1354
Embed a YouTube video via its embed url into a notebook.
from functools import partial
from IPython.display import display, IFrame
width, height = (560, 315, )
def _iframe_attrs(embed_url):
    Get IFrame args.
    return (
        ('src', 'width', 'height'), 
        (embed_url, width, height, ),
    )
def _get_args(embed_url):
    Get args for type to create a class.
    iframe = dict(zip(*_iframe_attrs(embed_url)))
    attrs = {
        'display': partial(display, IFrame(**iframe)),
    }
    return ('YouTubeVideo', (object, ), attrs, )
def youtube_video(embed_url):
    Embed YouTube video into a notebook.
    Place this module into the same directory as the notebook.
    >>> from embed import youtube_video
    >>> youtube_video(url).display()
    
    YouTubeVideo = type(*_get_args(embed_url)) # make a class
    return YouTubeVideo() # return an object
Explanation: More demo of Markdown code
Lists
Unordered
lists
are easy.
And
and ordered also ! Just
start lines by 1., 2. etc
or simply 1., 1., ...
Images
With a HTML &lt;img/&gt; tag or the ![alt](url) Markdown code:
<img width="100" src="agreg/images/dooku.jpg"/>
End of explanation
youtube_video("https://www.youtube.com/embed/FNg5_2UUCNU").display()
print(2**2021)
Explanation: And Markdown can include raw HTML
<center><span style="color: green;">This is a centered span, colored in green.</span></center>
Iframes are disabled by default, but by using the IPython internals we can include let say a YouTube video:
End of explanation
<END_TASK>