def insert_key(key, v, trie):
 if ((not key) or has_key(key, trie)):
  return
 for char in key:
  branch = _get_child_branch(trie, char)
  if (not branch):
   new_branch = [char]
   trie.append(new_branch)
   trie = new_branch
  else:
   trie = branch
 trie.append((key, v))

def insert_key ( key , v , trie ) : if ( ( not key ) or has_key ( key , trie ) ) : return for char in key : branch = _get_child_branch ( trie , char ) if ( not branch ) : new_branch = [ char ] trie . append ( new_branch ) trie = new_branch else : trie = branch trie . append ( ( key , v ) )
insert a pair into trie .