a trie python implementation