\begin{Verbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{key\PYGZus{}function} \PYG{o}{=} \PYG{k}{lambda} \PYG{n+nb}{id}\PYG{p}{:} \PYG{n+nb}{id}\PYG{o}{.}\PYG{n}{upper}\PYG{p}{()}    \PYG{c+c1}{\PYGZsh{} capitalizes the keys}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{idx} \PYG{o}{=} \PYG{n}{SearchIO}\PYG{o}{.}\PYG{n}{index}\PYG{p}{(}\PYG{l+s+s2}{\PYGZdq{}tab\PYGZus{}2226\PYGZus{}tblastn\PYGZus{}001.txt\PYGZdq{}}\PYG{p}{,} \PYG{l+s+s2}{\PYGZdq{}blast\PYGZhy{}tab\PYGZdq{}}\PYG{p}{,} \PYG{n}{key\PYGZus{}function}\PYG{o}{=}\PYG{n}{key\PYGZus{}function}\PYG{p}{)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n+nb}{sorted}\PYG{p}{(}\PYG{n}{idx}\PYG{o}{.}\PYG{n}{keys}\PYG{p}{())}
\PYG{g+go}{[\PYGZsq{}GI|11464971:4\PYGZhy{}101\PYGZsq{}, \PYGZsq{}GI|16080617|REF|NP\PYGZus{}391444.1|\PYGZsq{}]}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{idx}\PYG{p}{[}\PYG{l+s+s2}{\PYGZdq{}GI|16080617|REF|NP\PYGZus{}391444.1|\PYGZdq{}}\PYG{p}{]}
\PYG{g+go}{QueryResult(id=\PYGZsq{}gi|16080617|ref|NP\PYGZus{}391444.1|\PYGZsq{}, 3 hits)}
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{idx}\PYG{o}{.}\PYG{n}{close}\PYG{p}{()}
\end{Verbatim}
