def __contains__(self, key):
node = self.root<EOL>while len(key) > <NUM_LIT:0>:<EOL><INDENT>head, key = key[<NUM_LIT:0>], key[<NUM_LIT:1>:]<EOL>found = False<EOL>for st in node['<STR_LIT>']:<EOL><INDENT>if st[<NUM_LIT:0>] == head:<EOL><INDENT>found = True<EOL>node = st[<NUM_LIT:1>]<EOL>break<EOL><DEDENT><DEDENT>if not found:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return node['<STR_LIT>'] is not None<EOL>
Exact path membership: wildcards must be matched explicitly.