\begin{Verbatim}[commandchars=\\\{\}]
\PYG{n}{window} \PYG{o}{=} \PYG{l+m+mi}{7}
\PYG{n}{dict\PYGZus{}one} \PYG{o}{=} \PYG{p}{\PYGZob{}\PYGZcb{}}
\PYG{n}{dict\PYGZus{}two} \PYG{o}{=} \PYG{p}{\PYGZob{}\PYGZcb{}}
\PYG{k}{for} \PYG{p}{(}\PYG{n}{seq}\PYG{p}{,} \PYG{n}{section\PYGZus{}dict}\PYG{p}{)} \PYG{o+ow}{in} \PYG{p}{[}
    \PYG{p}{(}\PYG{n}{rec\PYGZus{}one}\PYG{o}{.}\PYG{n}{seq}\PYG{o}{.}\PYG{n}{upper}\PYG{p}{(),} \PYG{n}{dict\PYGZus{}one}\PYG{p}{),}
    \PYG{p}{(}\PYG{n}{rec\PYGZus{}two}\PYG{o}{.}\PYG{n}{seq}\PYG{o}{.}\PYG{n}{upper}\PYG{p}{(),} \PYG{n}{dict\PYGZus{}two}\PYG{p}{),}
\PYG{p}{]:}
    \PYG{k}{for} \PYG{n}{i} \PYG{o+ow}{in} \PYG{n+nb}{range}\PYG{p}{(}\PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{seq}\PYG{p}{)} \PYG{o}{\PYGZhy{}} \PYG{n}{window}\PYG{p}{):}
        \PYG{n}{section} \PYG{o}{=} \PYG{n}{seq}\PYG{p}{[}\PYG{n}{i} \PYG{p}{:} \PYG{n}{i} \PYG{o}{+} \PYG{n}{window}\PYG{p}{]}
        \PYG{k}{try}\PYG{p}{:}
            \PYG{n}{section\PYGZus{}dict}\PYG{p}{[}\PYG{n}{section}\PYG{p}{]}\PYG{o}{.}\PYG{n}{append}\PYG{p}{(}\PYG{n}{i}\PYG{p}{)}
        \PYG{k}{except} \PYG{n+ne}{KeyError}\PYG{p}{:}
            \PYG{n}{section\PYGZus{}dict}\PYG{p}{[}\PYG{n}{section}\PYG{p}{]} \PYG{o}{=} \PYG{p}{[}\PYG{n}{i}\PYG{p}{]}
\PYG{c+c1}{\PYGZsh{} Now find any sub\PYGZhy{}sequences found in both sequences}
\PYG{n}{matches} \PYG{o}{=} \PYG{n+nb}{set}\PYG{p}{(}\PYG{n}{dict\PYGZus{}one}\PYG{p}{)}\PYG{o}{.}\PYG{n}{intersection}\PYG{p}{(}\PYG{n}{dict\PYGZus{}two}\PYG{p}{)}
\PYG{n+nb}{print}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+si}{\PYGZpc{}i}\PYG{l+s+s2}{ unique matches\PYGZdq{}} \PYG{o}{\PYGZpc{}} \PYG{n+nb}{len}\PYG{p}{(}\PYG{n}{matches}\PYG{p}{))}
\end{Verbatim}
