def remove(self, val):
<EOL>_maxes = self._maxes<EOL>if not _maxes:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(val))<EOL><DEDENT>pos = bisect_left(_maxes, val)<EOL>if pos == len(_maxes):<EOL><INDENT>raise ValueError('<STR_LIT>'.format(val))<EOL><DEDENT>_lists = self._lists<EOL>idx = bisect_left(_lists[pos], val)<EOL>if _lists[pos][idx] == val:<EOL><INDENT>self._delete(pos, idx)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(val))<EOL><DEDENT>
Remove first occurrence of *val*.

Raises ValueError if *val* is not present.