| 118 | |
| 119 | |
| 120 | class RandomSet(set): |
| 121 | def __iter__(self): |
| 122 | l = list(set.__iter__(self)) |
| 123 | random.shuffle(l) |
| 124 | return iter(l) |
| 125 | |
| 126 | def pop(self): |
| 127 | index = random.randint(0, len(self) - 1) |
| 128 | item = list(set.__iter__(self))[index] |
| 129 | self.remove(item) |
| 130 | return item |
| 131 | |
| 132 | def union(self, other): |
| 133 | return RandomSet(set.union(self, other)) |
| 134 | |
| 135 | def difference(self, other): |
| 136 | return RandomSet(set.difference(self, other)) |
| 137 | |
| 138 | def intersection(self, other): |
| 139 | return RandomSet(set.intersection(self, other)) |
| 140 | |
| 141 | def copy(self): |
| 142 | return RandomSet(self) |
| 143 | |
| 144 | |
| 145 | def conforms_partial_ordering(tuples, sorted_elements): |
no outgoing calls
no test coverage detected