| 77 | |
| 78 | |
| 79 | class RandomSet(set): |
| 80 | def __iter__(self): |
| 81 | l = list(set.__iter__(self)) |
| 82 | random.shuffle(l) |
| 83 | return iter(l) |
| 84 | |
| 85 | def pop(self): |
| 86 | index = random.randint(0, len(self) - 1) |
| 87 | item = list(set.__iter__(self))[index] |
| 88 | self.remove(item) |
| 89 | return item |
| 90 | |
| 91 | def union(self, other): |
| 92 | return RandomSet(set.union(self, other)) |
| 93 | |
| 94 | def difference(self, other): |
| 95 | return RandomSet(set.difference(self, other)) |
| 96 | |
| 97 | def intersection(self, other): |
| 98 | return RandomSet(set.intersection(self, other)) |
| 99 | |
| 100 | def copy(self): |
| 101 | return RandomSet(self) |
| 102 | |
| 103 | |
| 104 | def conforms_partial_ordering(tuples, sorted_elements): |
no outgoing calls
no test coverage detected