def add(self, ranges):
if len(ranges) and isinstance(ranges[<NUM_LIT:0>], int_types):<EOL><INDENT>ranges = [ranges]<EOL><DEDENT>iset = self._iset<EOL>self._maxlen = max(self._maxlen, max(r[<NUM_LIT:1>] - r[<NUM_LIT:0>] + <NUM_LIT:1> for r in ranges))<EOL>if len(ranges) > <NUM_LIT:30> or len(iset) < len(ranges):<EOL><INDENT>iset.extend(ranges)<EOL>iset.sort()<EOL><DEDENT>else:<EOL><INDENT>for o in ranges:<EOL><INDENT>iset.insert(binsearch_left_start(iset, o[<NUM_LIT:0>], <NUM_LIT:0>, len(iset)), o)<EOL><DEDENT><DEDENT>
r"""Add a single (or many) [start, end, \*] item to the tree.