def __contains__(self, val):
_maxes = self._maxes<EOL>if not _maxes:<EOL><INDENT>return False<EOL><DEDENT>key = self._key(val)<EOL>pos = bisect_left(_maxes, key)<EOL>if pos == len(_maxes):<EOL><INDENT>return False<EOL><DEDENT>_lists = self._lists<EOL>_keys = self._keys<EOL>idx = bisect_left(_keys[pos], key)<EOL>len_keys = len(_keys)<EOL>len_sublist = len(_keys[pos])<EOL>while True:<EOL><INDENT>if _keys[pos][idx] != key:<EOL><INDENT>return False<EOL><DEDENT>if _lists[pos][idx] == val:<EOL><INDENT>return True<EOL><DEDENT>idx += <NUM_LIT:1><EOL>if idx == len_sublist:<EOL><INDENT>pos += <NUM_LIT:1><EOL>if pos == len_keys:<EOL><INDENT>return False<EOL><DEDENT>len_sublist = len(_keys[pos])<EOL>idx = <NUM_LIT:0><EOL><DEDENT><DEDENT>
Return True if and only if *val* is an element in the list.