Lines Matching refs:self
33 def __init__(self, data=None): argument
34 self.monotonic = False
35 self._extra = {}
37 self._parse_internal(data)
40 self.data = tuple(self._remove_pairs(data))
41 self.monotonic = all(x < y for x, y in zip(self.data, self.data[1:]))
43 self.data = ()
45 def __iter__(self): argument
46 for i in range(0, len(self.data), 2):
47 yield self.data[i:i+2]
49 def __eq__(self, other): argument
50 return self.data == other.data
52 def __ne__(self, other): argument
53 return self.data != other.data
55 def __nonzero__(self): argument
56 return bool(self.data)
58 def __str__(self): argument
59 if not self.data:
62 return self.to_string()
64 def __repr__(self): argument
65 return '<RangeSet("' + self.to_string() + '")>'
68 def extra(self): argument
69 return self._extra
101 def _parse_internal(self, text): argument
123 self.data = tuple(self._remove_pairs(data))
124 self.monotonic = monotonic
142 def to_string(self): argument
144 for i in range(0, len(self.data), 2):
145 s, e = self.data[i:i+2]
152 def to_string_raw(self): argument
153 assert self.data
154 return str(len(self.data)) + "," + ",".join(str(i) for i in self.data)
156 def union(self, other): argument
167 for p, d in heapq.merge(zip(self.data, itertools.cycle((+1, -1))),
174 def intersect(self, other): argument
185 for p, d in heapq.merge(zip(self.data, itertools.cycle((+1, -1))),
192 def subtract(self, other): argument
204 for p, d in heapq.merge(zip(self.data, itertools.cycle((+1, -1))),
211 def overlaps(self, other): argument
224 for _, d in heapq.merge(zip(self.data, itertools.cycle((+1, -1))),
231 def size(self): argument
240 for i, p in enumerate(self.data):
247 def map_within(self, other): argument
265 for p, d in heapq.merge(zip(self.data, itertools.cycle((-5, +5))),
276 def extend(self, n): argument
290 out = self
291 for i in range(0, len(self.data), 2):
292 s, e = self.data[i:i+2]
298 def first(self, n): argument
317 if self.size() <= n:
318 return self
321 for s, e in self:
330 def next_item(self): argument
340 for s, e in self: