Commit d7c62aee authored by boulanlo's avatar boulanlo

Removed temp directory

parent 97687917
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n}{extracted\PYGZus{}data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{][}\PYG{l+m+mi}{1}\PYG{p}{:]} \PYG{o}{=} \PYG{p}{[}\PYG{n}{datetime}\PYG{o}{.}\PYG{n}{datetime}\PYG{o}{.}\PYG{n}{strptime}\PYG{p}{(}\PYG{n}{date}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}\PYGZpc{}m/}\PYG{l+s+si}{\PYGZpc{}d}\PYG{l+s+s2}{/\PYGZpc{}y\PYGZdq{}}\PYG{p}{)} \PYG{k}{for} \PYG{n}{date} \PYG{o+ow}{in} \PYG{n}{extracted\PYGZus{}data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{][}\PYG{l+m+mi}{1}\PYG{p}{:]]}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n}{data}\PYG{o}{\PYGZdl{}}\PYG{n}{Date} \PYG{o}{\PYGZlt{}\PYGZhy{}} \PYG{n+nf}{as.Date}\PYG{p}{(}\PYG{n}{data}\PYG{o}{\PYGZdl{}}\PYG{n}{Date}\PYG{p}{)}
\PYG{n+nf}{summary}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{k+kn}{import} \PYG{n+nn}{sys}
\PYG{k}{if} \PYG{n}{sys}\PYG{o}{.}\PYG{n}{version\PYGZus{}info}\PYG{o}{.}\PYG{n}{major} \PYG{o}{\PYGZlt{}} \PYG{l+m+mi}{3} \PYG{o+ow}{or} \PYG{n}{sys}\PYG{o}{.}\PYG{n}{version\PYGZus{}info}\PYG{o}{.}\PYG{n}{minor} \PYG{o}{\PYGZlt{}} \PYG{l+m+mi}{6}\PYG{p}{:}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}Please use Python 3.6 (or higher)!\PYGZdq{}}\PYG{p}{)}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{p}{[}\PYG{n}{flipped\PYGZus{}data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{],} \PYG{k+kc}{None}\PYG{p}{]} \PYG{o}{+} \PYG{n}{flipped\PYGZus{}data}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:]}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{p}{(}\PYG{n+nb}{unless} \PYG{p}{(}\PYG{n+nb}{featurep} \PYG{l+s+ss}{\PYGZsq{}ob\PYGZhy{}python}\PYG{p}{)}
\PYG{p}{(}\PYG{n+nf}{print} \PYG{l+s}{\PYGZdq{}Please activate python in org\PYGZhy{}babel (org\PYGZhy{}babel\PYGZhy{}do\PYGZhy{}lnaguages)!\PYGZdq{}}\PYG{p}{))}
\PYG{p}{(}\PYG{n+nb}{unless} \PYG{p}{(}\PYG{n+nb}{featurep} \PYG{l+s+ss}{\PYGZsq{}ob\PYGZhy{}R}\PYG{p}{)}
\PYG{p}{(}\PYG{n+nf}{print} \PYG{l+s}{\PYGZdq{}Please activate R in org\PYGZhy{}babel (org\PYGZhy{}babel\PYGZhy{}do\PYGZhy{}lnaguages)!\PYGZdq{}}\PYG{p}{))}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n}{target\PYGZus{}countries} \PYG{o}{=} \PYG{p}{[}
\PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}Belgium\PYGZdq{}}\PYG{p}{],}
\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}Hong Kong\PYGZdq{}}\PYG{p}{,} \PYG{k+kc}{None}\PYG{p}{],}
\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}Hong Kong\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}China\PYGZdq{}}\PYG{p}{],} \PYG{c+c1}{\PYGZsh{} China without Hong Kong}
\PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}France\PYGZdq{}}\PYG{p}{],}
\PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}Germany\PYGZdq{}}\PYG{p}{],}
\PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}Iran\PYGZdq{}}\PYG{p}{],}
\PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}Italy\PYGZdq{}}\PYG{p}{],}
\PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}Japan\PYGZdq{}}\PYG{p}{],}
\PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}South Korea\PYGZdq{}}\PYG{p}{],}
\PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}Netherlands\PYGZdq{}}\PYG{p}{],}
\PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}United Kingdom\PYGZdq{}}\PYG{p}{],}
\PYG{p}{[}\PYG{k+kc}{None}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}US\PYGZdq{}}\PYG{p}{]}
\PYG{p}{]}
\PYG{k}{def} \PYG{n+nf}{is\PYGZus{}target\PYGZus{}country}\PYG{p}{(}\PYG{n}{province}\PYG{p}{,} \PYG{n}{country}\PYG{p}{):}
\PYG{n}{specific\PYGZus{}province} \PYG{o}{=} \PYG{k}{lambda} \PYG{n}{t}\PYG{p}{,} \PYG{n}{p}\PYG{p}{,} \PYG{n}{c}\PYG{p}{:} \PYG{n}{t}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{==} \PYG{n}{p} \PYG{o+ow}{and} \PYG{n}{t}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o+ow}{is} \PYG{k+kc}{None}
\PYG{n}{without\PYGZus{}specific\PYGZus{}province} \PYG{o}{=} \PYG{k}{lambda} \PYG{n}{t}\PYG{p}{,} \PYG{n}{p}\PYG{p}{,} \PYG{n}{c}\PYG{p}{:} \PYG{n}{t}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o+ow}{is} \PYG{o+ow}{not} \PYG{k+kc}{None} \PYG{o+ow}{and} \PYG{n}{t}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{!=} \PYG{n}{p} \PYG{o+ow}{and} \PYG{n}{t}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{==} \PYG{n}{c}
\PYG{n}{without\PYGZus{}provinces} \PYG{o}{=} \PYG{k}{lambda} \PYG{n}{t}\PYG{p}{,} \PYG{n}{p}\PYG{p}{,} \PYG{n}{c}\PYG{p}{:} \PYG{n}{t}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o+ow}{is} \PYG{k+kc}{None} \PYG{o+ow}{and} \PYG{n}{p} \PYG{o}{==} \PYG{l+s+s2}{\PYGZdq{}\PYGZdq{}} \PYG{o+ow}{and} \PYG{n}{t}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{==} \PYG{n}{c}
\PYG{n}{check} \PYG{o}{=} \PYG{k}{lambda} \PYG{n}{t}\PYG{p}{,} \PYG{n}{p}\PYG{p}{,} \PYG{n}{c}\PYG{p}{:} \PYG{n}{specific\PYGZus{}province}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{p}\PYG{p}{,} \PYG{n}{c}\PYG{p}{)} \PYG{o+ow}{or} \PYG{n}{without\PYGZus{}specific\PYGZus{}province}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{p}\PYG{p}{,} \PYG{n}{c}\PYG{p}{)} \PYG{o+ow}{or} \PYG{n}{without\PYGZus{}provinces}\PYG{p}{(}\PYG{n}{t}\PYG{p}{,} \PYG{n}{p}\PYG{p}{,} \PYG{n}{c}\PYG{p}{)}
\PYG{n}{res} \PYG{o}{=} \PYG{p}{[}\PYG{n}{check}\PYG{p}{(}\PYG{n}{target}\PYG{p}{,} \PYG{n}{province}\PYG{p}{,} \PYG{n}{country}\PYG{p}{)} \PYG{k}{for} \PYG{n}{target} \PYG{o+ow}{in} \PYG{n}{target\PYGZus{}countries}\PYG{p}{]}
\PYG{k}{return} \PYG{n+nb}{any}\PYG{p}{(}\PYG{n}{res}\PYG{p}{)}
\PYG{n}{extracted\PYGZus{}data} \PYG{o}{=} \PYG{p}{[]}
\PYG{n}{extracted\PYGZus{}data}\PYG{o}{.}\PYG{n}{append}\PYG{p}{([}\PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{][}\PYG{l+m+mi}{1}\PYG{p}{]]} \PYG{o}{+} \PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{][}\PYG{l+m+mi}{4}\PYG{p}{:])}
\PYG{k}{for} \PYG{n}{row} \PYG{o+ow}{in} \PYG{n}{valid\PYGZus{}data}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:]:}
\PYG{k}{if} \PYG{l+s+s2}{\PYGZdq{}Korea\PYGZdq{}} \PYG{o+ow}{in} \PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]:}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{])}
\PYG{k}{if} \PYG{n}{is\PYGZus{}target\PYGZus{}country}\PYG{p}{(}\PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{],} \PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]):}
\PYG{c+c1}{\PYGZsh{} print(row[0])}
\PYG{k}{if} \PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{==} \PYG{l+s+s2}{\PYGZdq{}Hong Kong\PYGZdq{}}\PYG{p}{:}
\PYG{n}{extracted\PYGZus{}data}\PYG{o}{.}\PYG{n}{append}\PYG{p}{([}\PYG{l+s+s2}{\PYGZdq{}Hong Kong\PYGZdq{}}\PYG{p}{]} \PYG{o}{+} \PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{:])}
\PYG{k}{elif} \PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]} \PYG{o}{==} \PYG{l+s+s2}{\PYGZdq{}China\PYGZdq{}}\PYG{p}{:}
\PYG{k}{try}\PYG{p}{:}
\PYG{n}{idx} \PYG{o}{=} \PYG{p}{[}\PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{k}{for} \PYG{n}{row} \PYG{o+ow}{in} \PYG{n}{extracted\PYGZus{}data}\PYG{p}{]}\PYG{o}{.}\PYG{n}{index}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}China\PYGZdq{}}\PYG{p}{)}
\PYG{n}{extracted\PYGZus{}data}\PYG{p}{[}\PYG{n}{idx}\PYG{p}{][}\PYG{l+m+mi}{1}\PYG{p}{:]} \PYG{o}{=} \PYG{p}{[}\PYG{n+nb}{int}\PYG{p}{(}\PYG{n}{a}\PYG{p}{)} \PYG{o}{+} \PYG{n+nb}{int}\PYG{p}{(}\PYG{n}{b}\PYG{p}{)} \PYG{k}{for} \PYG{n}{a}\PYG{p}{,} \PYG{n}{b} \PYG{o+ow}{in} \PYG{n+nb}{zip}\PYG{p}{(}\PYG{n}{extracted\PYGZus{}data}\PYG{p}{[}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{][}\PYG{l+m+mi}{1}\PYG{p}{:],} \PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{:])]}
\PYG{k}{except} \PYG{n+ne}{ValueError}\PYG{p}{:}
\PYG{n}{extracted\PYGZus{}data}\PYG{o}{.}\PYG{n}{append}\PYG{p}{([}\PYG{l+s+s2}{\PYGZdq{}China\PYGZdq{}}\PYG{p}{]} \PYG{o}{+} \PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{:])}
\PYG{k}{else}\PYG{p}{:}
\PYG{n}{extracted\PYGZus{}data}\PYG{o}{.}\PYG{n}{append}\PYG{p}{([}\PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{]]} \PYG{o}{+} \PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{:])}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n+nf}{library}\PYG{p}{(}\PYG{n}{tidyverse}\PYG{p}{)}
\PYG{n+nf}{library}\PYG{p}{(}\PYG{n}{ggrepel}\PYG{p}{)}
\PYG{n+nf}{library}\PYG{p}{(}\PYG{n}{scales}\PYG{p}{)}
\PYG{n}{last\PYGZus{}date} \PYG{o}{\PYGZlt{}\PYGZhy{}} \PYG{n}{data} \PYG{o}{\PYGZpc{}\PYGZgt{}\PYGZpc{}}
\PYG{n+nf}{gather}\PYG{p}{(}\PYG{n}{Country}\PYG{p}{,} \PYG{n}{Cases}\PYG{p}{,} \PYG{n}{Belgium}\PYG{o}{:}\PYG{n}{UnitedKingdom}\PYG{p}{)} \PYG{o}{\PYGZpc{}\PYGZgt{}\PYGZpc{}}
\PYG{n}{dplyr}\PYG{o}{::}\PYG{n+nf}{filter}\PYG{p}{(}\PYG{n}{Date} \PYG{o}{==} \PYG{n+nf}{tail}\PYG{p}{(}\PYG{n}{data}\PYG{o}{\PYGZdl{}}\PYG{n}{Date}\PYG{p}{,} \PYG{l+m}{1}\PYG{p}{),} \PYG{n}{Country} \PYG{o}{\PYGZpc{}in\PYGZpc{}} \PYG{n+nf}{c}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}US\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}France\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}Germany\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}China\PYGZdq{}}\PYG{p}{))}
\PYG{c+c1}{\PYGZsh{} Color\PYGZhy{}blind friendly palette taken from}
\PYG{c+c1}{\PYGZsh{} https://bconnelly.net/posts/creating\PYGZus{}colorblind\PYGZhy{}friendly\PYGZus{}figures/}
\PYG{c+c1}{\PYGZsh{} with added grayscale values}
\PYG{n}{palette} \PYG{o}{\PYGZlt{}\PYGZhy{}} \PYG{n+nf}{c}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}\PYGZsh{}000000\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}\PYGZsh{}E69F00\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}\PYGZsh{}56B4E9\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}\PYGZsh{}009E73\PYGZdq{}}\PYG{p}{,}
\PYG{l+s}{\PYGZdq{}\PYGZsh{}292929\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}\PYGZsh{}555555\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}\PYGZsh{}999999\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}\PYGZsh{}BBBBBB\PYGZdq{}}\PYG{p}{,}
\PYG{l+s}{\PYGZdq{}\PYGZsh{}F0E442\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}\PYGZsh{}0072B2\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}\PYGZsh{}D55E00\PYGZdq{}}\PYG{p}{,} \PYG{l+s}{\PYGZdq{}\PYGZsh{}CC79A7\PYGZdq{}}\PYG{p}{)}
\PYG{n}{data} \PYG{o}{\PYGZpc{}\PYGZgt{}\PYGZpc{}}
\PYG{n+nf}{gather}\PYG{p}{(}\PYG{n}{Country}\PYG{p}{,} \PYG{n}{Cases}\PYG{p}{,} \PYG{n}{Belgium}\PYG{o}{:}\PYG{n}{UnitedKingdom}\PYG{p}{)} \PYG{o}{\PYGZpc{}\PYGZgt{}\PYGZpc{}}
\PYG{n+nf}{ggplot}\PYG{p}{(}\PYG{n+nf}{aes}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{n}{Date}\PYG{p}{,} \PYG{n}{y}\PYG{o}{=}\PYG{n}{Cases}\PYG{p}{,} \PYG{n}{colour}\PYG{o}{=}\PYG{n}{Country}\PYG{p}{))} \PYG{o}{+}
\PYG{n+nf}{geom\PYGZus{}line}\PYG{p}{()} \PYG{o}{+}
\PYG{n+nf}{scale\PYGZus{}x\PYGZus{}date}\PYG{p}{(}\PYG{n}{breaks} \PYG{o}{=} \PYG{n+nf}{pretty\PYGZus{}breaks}\PYG{p}{(}\PYG{l+m}{8}\PYG{p}{),} \PYG{n}{labels} \PYG{o}{=} \PYG{n+nf}{date\PYGZus{}format}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}\PYGZpc{}b \PYGZpc{}Y\PYGZdq{}}\PYG{p}{))} \PYG{o}{+}
\PYG{n+nf}{scale\PYGZus{}color\PYGZus{}manual}\PYG{p}{(}\PYG{n}{values}\PYG{o}{=}\PYG{n}{palette}\PYG{p}{)} \PYG{o}{+}
\PYG{n+nf}{scale\PYGZus{}y\PYGZus{}continuous}\PYG{p}{(}\PYG{n}{labels} \PYG{o}{=} \PYG{n+nf}{comma\PYGZus{}format}\PYG{p}{(),} \PYG{n}{breaks} \PYG{o}{=} \PYG{n+nf}{pretty\PYGZus{}breaks}\PYG{p}{(}\PYG{l+m}{8}\PYG{p}{))} \PYG{o}{+}
\PYG{n+nf}{geom\PYGZus{}text\PYGZus{}repel}\PYG{p}{(}\PYG{n}{data}\PYG{o}{=}\PYG{n}{last\PYGZus{}date}\PYG{p}{,} \PYG{n+nf}{aes}\PYG{p}{(}\PYG{n}{label} \PYG{o}{=} \PYG{n}{Country}\PYG{p}{))} \PYG{o}{+}
\PYG{n+nf}{ggtitle}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}Cumulative confirmed cases of Covid\PYGZhy{}19\PYGZdq{}}\PYG{p}{,} \PYG{n}{subtitle}\PYG{o}{=}\PYG{l+s}{\PYGZdq{}In selected countries since the beginning of 2020\PYGZdq{}}\PYG{p}{)} \PYG{o}{+}
\PYG{n+nf}{theme\PYGZus{}bw}\PYG{p}{()}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n}{flipped\PYGZus{}data} \PYG{o}{=} \PYG{p}{[[}\PYG{n+nb}{str}\PYG{p}{(}\PYG{n}{row}\PYG{p}{[}\PYG{n}{i}\PYG{p}{])} \PYG{k}{for} \PYG{n}{row} \PYG{o+ow}{in} \PYG{n}{extracted\PYGZus{}data}\PYG{p}{]} \PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{extracted\PYGZus{}data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]))]}
\PYG{n}{flipped\PYGZus{}data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{][}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{l+s+s2}{\PYGZdq{}Date\PYGZdq{}}
\PYG{n}{flipped\PYGZus{}data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[}\PYG{n}{s}\PYG{o}{.}\PYG{n}{replace}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{} \PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}\PYGZdq{}}\PYG{p}{)} \PYG{k}{for} \PYG{n}{s} \PYG{o+ow}{in} \PYG{n}{flipped\PYGZus{}data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{]]}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n+nf}{plot}\PYG{p}{(}\PYG{n}{data}\PYG{p}{[,}\PYG{l+s}{\PYGZsq{}Date\PYGZsq{}}\PYG{p}{],} \PYG{n}{data}\PYG{p}{[,}\PYG{l+s}{\PYGZsq{}France\PYGZsq{}}\PYG{p}{],} \PYG{n}{xlab}\PYG{o}{=}\PYG{l+s}{\PYGZdq{}Date\PYGZdq{}}\PYG{p}{,}
\PYG{n}{ylab}\PYG{o}{=}\PYG{l+s}{\PYGZdq{}Confirmed cases in Metropolitan France, cumulative\PYGZdq{}}\PYG{p}{)}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{k+kn}{from} \PYG{n+nn}{urllib.request} \PYG{k+kn}{import} \PYG{n}{urlopen}
\PYG{k+kn}{import} \PYG{n+nn}{datetime}
\PYG{n}{temp\PYGZus{}file\PYGZus{}name} \PYG{o}{=} \PYG{l+s+s1}{\PYGZsq{}data.csv\PYGZsq{}}
\PYG{c+c1}{\PYGZsh{} Downloads the data from GitHub}
\PYG{k}{def} \PYG{n+nf}{download\PYGZus{}data}\PYG{p}{():}
\PYG{n}{data} \PYG{o}{=} \PYG{n}{urlopen}\PYG{p}{(}\PYG{n}{data\PYGZus{}url}\PYG{p}{)}\PYG{o}{.}\PYG{n}{read}\PYG{p}{()}
\PYG{k}{with} \PYG{n+nb}{open}\PYG{p}{(}\PYG{n}{temp\PYGZus{}file\PYGZus{}name}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}wb\PYGZsq{}}\PYG{p}{)} \PYG{k}{as} \PYG{n}{f}\PYG{p}{:}
\PYG{n}{f}\PYG{o}{.}\PYG{n}{write}\PYG{p}{(}\PYG{n}{data}\PYG{p}{)}
\PYG{c+c1}{\PYGZsh{} Tries to read data from the local file and returns the content}
\PYG{c+c1}{\PYGZsh{} parsed as a series of lines}
\PYG{k}{def} \PYG{n+nf}{read\PYGZus{}data}\PYG{p}{():}
\PYG{k}{try}\PYG{p}{:}
\PYG{k}{with} \PYG{n+nb}{open}\PYG{p}{(}\PYG{n}{temp\PYGZus{}file\PYGZus{}name}\PYG{p}{,} \PYG{l+s+s1}{\PYGZsq{}r\PYGZsq{}}\PYG{p}{)} \PYG{k}{as} \PYG{n}{f}\PYG{p}{:}
\PYG{n}{data} \PYG{o}{=} \PYG{n}{f}\PYG{o}{.}\PYG{n}{read}\PYG{p}{()}
\PYG{n}{lines} \PYG{o}{=} \PYG{n}{data}\PYG{o}{.}\PYG{n}{split}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{}}\PYG{l+s+se}{\PYGZbs{}n}\PYG{l+s+s1}{\PYGZsq{}}\PYG{p}{)}
\PYG{n}{table} \PYG{o}{=} \PYG{p}{[}\PYG{n}{line}\PYG{o}{.}\PYG{n}{replace}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+se}{\PYGZbs{}\PYGZdq{}}\PYG{l+s+s2}{Korea, South}\PYG{l+s+se}{\PYGZbs{}\PYGZdq{}}\PYG{l+s+s2}{\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}South Korea\PYGZdq{}}\PYG{p}{)}\PYG{o}{.}\PYG{n}{split}\PYG{p}{(}\PYG{l+s+s1}{\PYGZsq{},\PYGZsq{}}\PYG{p}{)} \PYG{k}{for} \PYG{n}{line} \PYG{o+ow}{in} \PYG{n}{lines}\PYG{p}{]}
\PYG{k}{return} \PYG{n}{table}\PYG{p}{[:}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{2}\PYG{p}{]} \PYG{c+c1}{\PYGZsh{} Removing the empty last line}
\PYG{k}{except} \PYG{n+ne}{IOError} \PYG{k}{as} \PYG{n}{e}\PYG{p}{:}
\PYG{k}{raise} \PYG{n}{e}
\PYG{c+c1}{\PYGZsh{} Decides whether or not to download the file from GitHub based on the}
\PYG{c+c1}{\PYGZsh{} presence of a local file and the last recorded date in the local}
\PYG{c+c1}{\PYGZsh{} file}
\PYG{k}{def} \PYG{n+nf}{try\PYGZus{}download\PYGZus{}data}\PYG{p}{():}
\PYG{n}{data} \PYG{o}{=} \PYG{k+kc}{None}
\PYG{k}{try}\PYG{p}{:}
\PYG{n}{data} \PYG{o}{=} \PYG{n}{read\PYGZus{}data}\PYG{p}{()}
\PYG{n}{last\PYGZus{}date} \PYG{o}{=} \PYG{n}{datetime}\PYG{o}{.}\PYG{n}{datetime}\PYG{o}{.}\PYG{n}{strptime}\PYG{p}{(}\PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{][}\PYG{o}{\PYGZhy{}}\PYG{l+m+mi}{1}\PYG{p}{],} \PYG{l+s+s2}{\PYGZdq{}\PYGZpc{}m/}\PYG{l+s+si}{\PYGZpc{}d}\PYG{l+s+s2}{/\PYGZpc{}y\PYGZdq{}}\PYG{p}{)}
\PYG{n}{today} \PYG{o}{=} \PYG{n}{datetime}\PYG{o}{.}\PYG{n}{datetime}\PYG{o}{.}\PYG{n}{today}\PYG{p}{()}
\PYG{k}{if} \PYG{n}{today} \PYG{o}{\PYGZhy{}} \PYG{n}{last\PYGZus{}date} \PYG{o}{\PYGZgt{}} \PYG{n}{datetime}\PYG{o}{.}\PYG{n}{timedelta}\PYG{p}{(}\PYG{n}{day}\PYG{o}{=}\PYG{l+m+mi}{1}\PYG{p}{):}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}Data obsolete, downloading new data...\PYGZdq{}}\PYG{p}{)}
\PYG{n}{download\PYGZus{}data}\PYG{p}{()}
\PYG{n}{data} \PYG{o}{=} \PYG{n}{read\PYGZus{}data}\PYG{p}{()}
\PYG{k}{except} \PYG{n+ne}{IOError}\PYG{p}{:}
\PYG{n}{download\PYGZus{}data}\PYG{p}{()}
\PYG{n}{data} \PYG{o}{=} \PYG{n}{read\PYGZus{}data}\PYG{p}{()}
\PYG{k}{finally}\PYG{p}{:}
\PYG{k}{return} \PYG{n}{data}
\PYG{n}{data} \PYG{o}{=} \PYG{n}{try\PYGZus{}download\PYGZus{}data}\PYG{p}{()}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n}{last\PYGZus{}date} \PYG{o}{\PYGZlt{}\PYGZhy{}} \PYG{n}{data} \PYG{o}{\PYGZpc{}\PYGZgt{}\PYGZpc{}}
\PYG{n+nf}{gather}\PYG{p}{(}\PYG{n}{Country}\PYG{p}{,} \PYG{n}{Cases}\PYG{p}{,} \PYG{n}{Belgium}\PYG{o}{:}\PYG{n}{UnitedKingdom}\PYG{p}{)} \PYG{o}{\PYGZpc{}\PYGZgt{}\PYGZpc{}}
\PYG{n}{dplyr}\PYG{o}{::}\PYG{n+nf}{filter}\PYG{p}{(}\PYG{n}{Date} \PYG{o}{==} \PYG{n+nf}{tail}\PYG{p}{(}\PYG{n}{data}\PYG{o}{\PYGZdl{}}\PYG{n}{Date}\PYG{p}{,} \PYG{l+m}{1}\PYG{p}{))}
\PYG{n}{data} \PYG{o}{\PYGZpc{}\PYGZgt{}\PYGZpc{}}
\PYG{n+nf}{gather}\PYG{p}{(}\PYG{n}{Country}\PYG{p}{,} \PYG{n}{Cases}\PYG{p}{,} \PYG{n}{Belgium}\PYG{o}{:}\PYG{n}{UnitedKingdom}\PYG{p}{)} \PYG{o}{\PYGZpc{}\PYGZgt{}\PYGZpc{}}
\PYG{n+nf}{ggplot}\PYG{p}{(}\PYG{n+nf}{aes}\PYG{p}{(}\PYG{n}{x}\PYG{o}{=}\PYG{n}{Date}\PYG{p}{,} \PYG{n}{y}\PYG{o}{=}\PYG{n}{Cases}\PYG{p}{,} \PYG{n}{colour}\PYG{o}{=}\PYG{n}{Country}\PYG{p}{))} \PYG{o}{+}
\PYG{n+nf}{geom\PYGZus{}line}\PYG{p}{()} \PYG{o}{+}
\PYG{n+nf}{scale\PYGZus{}x\PYGZus{}date}\PYG{p}{(}\PYG{n}{breaks} \PYG{o}{=} \PYG{n+nf}{pretty\PYGZus{}breaks}\PYG{p}{(}\PYG{l+m}{8}\PYG{p}{),} \PYG{n}{labels} \PYG{o}{=} \PYG{n+nf}{date\PYGZus{}format}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}\PYGZpc{}b \PYGZpc{}Y\PYGZdq{}}\PYG{p}{))} \PYG{o}{+}
\PYG{n+nf}{scale\PYGZus{}color\PYGZus{}manual}\PYG{p}{(}\PYG{n}{values}\PYG{o}{=}\PYG{n}{palette}\PYG{p}{)} \PYG{o}{+}
\PYG{n+nf}{scale\PYGZus{}y\PYGZus{}continuous}\PYG{p}{(}\PYG{n}{trans}\PYG{o}{=}\PYG{l+s}{\PYGZdq{}log10\PYGZdq{}}\PYG{p}{,} \PYG{n}{labels} \PYG{o}{=} \PYG{n+nf}{comma\PYGZus{}format}\PYG{p}{())} \PYG{o}{+}
\PYG{n+nf}{geom\PYGZus{}text\PYGZus{}repel}\PYG{p}{(}\PYG{n}{data}\PYG{o}{=}\PYG{n}{last\PYGZus{}date}\PYG{p}{,} \PYG{n+nf}{aes}\PYG{p}{(}\PYG{n}{label} \PYG{o}{=} \PYG{n}{Country}\PYG{p}{))} \PYG{o}{+}
\PYG{n+nf}{ggtitle}\PYG{p}{(}\PYG{l+s}{\PYGZdq{}Cumulative confirmed cases of Covid\PYGZhy{}19\PYGZdq{}}\PYG{p}{,} \PYG{n}{subtitle}\PYG{o}{=}\PYG{l+s}{\PYGZdq{}In selected countries since the beginning of 2020, on a logarithmic scale\PYGZdq{}}\PYG{p}{)} \PYG{o}{+}
\PYG{n+nf}{theme\PYGZus{}bw}\PYG{p}{()}
\end{Verbatim}
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n}{valid\PYGZus{}data} \PYG{o}{=} \PYG{p}{[]}
\PYG{n}{valid\PYGZus{}data}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{0}\PYG{p}{])}
\PYG{k}{for} \PYG{n}{row} \PYG{o+ow}{in} \PYG{n}{data}\PYG{p}{[}\PYG{l+m+mi}{1}\PYG{p}{:]:}
\PYG{n}{missing} \PYG{o}{=} \PYG{n+nb}{any}\PYG{p}{([}\PYG{n}{value} \PYG{o}{==} \PYG{l+s+s1}{\PYGZsq{}\PYGZsq{}} \PYG{k}{for} \PYG{n}{value} \PYG{o+ow}{in} \PYG{n}{row}\PYG{p}{[}\PYG{l+m+mi}{4}\PYG{p}{:]])}
\PYG{k}{if} \PYG{n}{missing}\PYG{p}{:}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{n}{row}\PYG{p}{)}
\PYG{k}{else}\PYG{p}{:}
\PYG{n}{valid\PYGZus{}data}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{row}\PYG{p}{)}
\end{Verbatim}
\makeatletter
\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax%
\let\PYG@ul=\relax \let\PYG@tc=\relax%
\let\PYG@bc=\relax \let\PYG@ff=\relax}
\def\PYG@tok#1{\csname PYG@tok@#1\endcsname}
\def\PYG@toks#1+{\ifx\relax#1\empty\else%
\PYG@tok{#1}\expandafter\PYG@toks\fi}
\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{%
\PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}}
\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}}
\expandafter\def\csname PYG@tok@w\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
\expandafter\def\csname PYG@tok@c\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PYG@tok@cp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.74,0.48,0.00}{##1}}}
\expandafter\def\csname PYG@tok@k\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYG@tok@kp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYG@tok@kt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}}
\expandafter\def\csname PYG@tok@o\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYG@tok@ow\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYG@tok@nf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PYG@tok@nc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PYG@tok@nn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PYG@tok@ne\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.82,0.25,0.23}{##1}}}
\expandafter\def\csname PYG@tok@nv\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYG@tok@no\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
\expandafter\def\csname PYG@tok@nl\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.63,0.00}{##1}}}
\expandafter\def\csname PYG@tok@ni\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}}
\expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.49,0.56,0.16}{##1}}}
\expandafter\def\csname PYG@tok@nt\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYG@tok@nd\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\expandafter\def\csname PYG@tok@s\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYG@tok@sd\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYG@tok@si\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
\expandafter\def\csname PYG@tok@se\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.73,0.40,0.13}{##1}}}
\expandafter\def\csname PYG@tok@sr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
\expandafter\def\csname PYG@tok@ss\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYG@tok@sx\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYG@tok@m\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYG@tok@gh\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\expandafter\def\csname PYG@tok@gu\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
\expandafter\def\csname PYG@tok@gd\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
\expandafter\def\csname PYG@tok@gi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}}
\expandafter\def\csname PYG@tok@gr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}}
\expandafter\def\csname PYG@tok@ge\endcsname{\let\PYG@it=\textit}
\expandafter\def\csname PYG@tok@gs\endcsname{\let\PYG@bf=\textbf}
\expandafter\def\csname PYG@tok@gp\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\expandafter\def\csname PYG@tok@go\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
\expandafter\def\csname PYG@tok@gt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
\expandafter\def\csname PYG@tok@err\endcsname{\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}
\expandafter\def\csname PYG@tok@kc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYG@tok@kd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYG@tok@kn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYG@tok@kr\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYG@tok@bp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYG@tok@fm\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PYG@tok@vc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYG@tok@vg\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYG@tok@vi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYG@tok@vm\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYG@tok@sa\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYG@tok@sb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYG@tok@sc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYG@tok@dl\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYG@tok@s2\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYG@tok@sh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYG@tok@s1\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYG@tok@mb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYG@tok@mf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYG@tok@mh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYG@tok@mi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYG@tok@il\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYG@tok@mo\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYG@tok@ch\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PYG@tok@cm\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PYG@tok@cpf\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PYG@tok@c1\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PYG@tok@cs\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\def\PYGZbs{\char`\\}
\def\PYGZus{\char`\_}
\def\PYGZob{\char`\{}
\def\PYGZcb{\char`\}}
\def\PYGZca{\char`\^}
\def\PYGZam{\char`\&}
\def\PYGZlt{\char`\<}
\def\PYGZgt{\char`\>}
\def\PYGZsh{\char`\#}
\def\PYGZpc{\char`\%}
\def\PYGZdl{\char`\$}
\def\PYGZhy{\char`\-}
\def\PYGZsq{\char`\'}
\def\PYGZdq{\char`\"}
\def\PYGZti{\char`\~}
% for compatibility with earlier versions
\def\PYGZat{@}
\def\PYGZlb{[}
\def\PYGZrb{]}
\makeatother
\makeatletter
\def\PYGdefault@reset{\let\PYGdefault@it=\relax \let\PYGdefault@bf=\relax%
\let\PYGdefault@ul=\relax \let\PYGdefault@tc=\relax%
\let\PYGdefault@bc=\relax \let\PYGdefault@ff=\relax}
\def\PYGdefault@tok#1{\csname PYGdefault@tok@#1\endcsname}
\def\PYGdefault@toks#1+{\ifx\relax#1\empty\else%
\PYGdefault@tok{#1}\expandafter\PYGdefault@toks\fi}
\def\PYGdefault@do#1{\PYGdefault@bc{\PYGdefault@tc{\PYGdefault@ul{%
\PYGdefault@it{\PYGdefault@bf{\PYGdefault@ff{#1}}}}}}}
\def\PYGdefault#1#2{\PYGdefault@reset\PYGdefault@toks#1+\relax+\PYGdefault@do{#2}}
\expandafter\def\csname PYGdefault@tok@w\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
\expandafter\def\csname PYGdefault@tok@c\endcsname{\let\PYGdefault@it=\textit\def\PYGdefault@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PYGdefault@tok@cp\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.74,0.48,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@k\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@kp\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@kt\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}}
\expandafter\def\csname PYGdefault@tok@o\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYGdefault@tok@ow\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@nb\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@nf\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@nc\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@nn\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@ne\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.82,0.25,0.23}{##1}}}
\expandafter\def\csname PYGdefault@tok@nv\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYGdefault@tok@no\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@nl\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.63,0.63,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@ni\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}}
\expandafter\def\csname PYGdefault@tok@na\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.49,0.56,0.16}{##1}}}
\expandafter\def\csname PYGdefault@tok@nt\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@nd\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@s\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYGdefault@tok@sd\endcsname{\let\PYGdefault@it=\textit\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYGdefault@tok@si\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
\expandafter\def\csname PYGdefault@tok@se\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.40,0.13}{##1}}}
\expandafter\def\csname PYGdefault@tok@sr\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}}
\expandafter\def\csname PYGdefault@tok@ss\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYGdefault@tok@sx\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@m\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYGdefault@tok@gh\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\expandafter\def\csname PYGdefault@tok@gu\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
\expandafter\def\csname PYGdefault@tok@gd\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@gi\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@gr\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@ge\endcsname{\let\PYGdefault@it=\textit}
\expandafter\def\csname PYGdefault@tok@gs\endcsname{\let\PYGdefault@bf=\textbf}
\expandafter\def\csname PYGdefault@tok@gp\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\expandafter\def\csname PYGdefault@tok@go\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}}
\expandafter\def\csname PYGdefault@tok@gt\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
\expandafter\def\csname PYGdefault@tok@err\endcsname{\def\PYGdefault@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}
\expandafter\def\csname PYGdefault@tok@kc\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@kd\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@kn\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@kr\endcsname{\let\PYGdefault@bf=\textbf\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@bp\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@fm\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\expandafter\def\csname PYGdefault@tok@vc\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYGdefault@tok@vg\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYGdefault@tok@vi\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYGdefault@tok@vm\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\expandafter\def\csname PYGdefault@tok@sa\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYGdefault@tok@sb\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYGdefault@tok@sc\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYGdefault@tok@dl\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYGdefault@tok@s2\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYGdefault@tok@sh\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYGdefault@tok@s1\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\expandafter\def\csname PYGdefault@tok@mb\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYGdefault@tok@mf\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYGdefault@tok@mh\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYGdefault@tok@mi\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYGdefault@tok@il\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYGdefault@tok@mo\endcsname{\def\PYGdefault@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\expandafter\def\csname PYGdefault@tok@ch\endcsname{\let\PYGdefault@it=\textit\def\PYGdefault@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PYGdefault@tok@cm\endcsname{\let\PYGdefault@it=\textit\def\PYGdefault@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PYGdefault@tok@cpf\endcsname{\let\PYGdefault@it=\textit\def\PYGdefault@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PYGdefault@tok@c1\endcsname{\let\PYGdefault@it=\textit\def\PYGdefault@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\expandafter\def\csname PYGdefault@tok@cs\endcsname{\let\PYGdefault@it=\textit\def\PYGdefault@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}}
\def\PYGdefaultZbs{\char`\\}
\def\PYGdefaultZus{\char`\_}
\def\PYGdefaultZob{\char`\{}
\def\PYGdefaultZcb{\char`\}}
\def\PYGdefaultZca{\char`\^}
\def\PYGdefaultZam{\char`\&}
\def\PYGdefaultZlt{\char`\<}
\def\PYGdefaultZgt{\char`\>}
\def\PYGdefaultZsh{\char`\#}
\def\PYGdefaultZpc{\char`\%}
\def\PYGdefaultZdl{\char`\$}
\def\PYGdefaultZhy{\char`\-}
\def\PYGdefaultZsq{\char`\'}
\def\PYGdefaultZdq{\char`\"}
\def\PYGdefaultZti{\char`\~}
% for compatibility with earlier versions
\def\PYGdefaultZat{@}
\def\PYGdefaultZlb{[}
\def\PYGdefaultZrb{]}
\makeatother
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment