Every line of 'python set intersection' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
191 def intersection(self, other): 192 other = set(other) 193 return self._from_iterable(item for item in self if item in other)
506 def intersection_update(self, other): 507 """Update self to include only the intersection with other.""" 508 other = set(other) 509 indices_to_delete = set() 510 for i, elem in enumerate(self): 511 if elem not in other: 512 indices_to_delete.add(i) 513 if indices_to_delete: 514 self._delete_values_by_index(indices_to_delete)
191 def intersection(self, *others): # & 192 '''Like C{frozen/set.intersection}. 193 194 @return: New instance (L{FrozenSet} or L{Set}). 195 ''' 196 return self.__class__(self._set.intersection(*others))
284 def intersection_update(self, *others): # &= 285 '''Like C{set.intersection_update}. 286 ''' 287 self._set.intersection_update(*others)
74 def intersect(self, other): 75 if self.set_container.intersection(other.set_container): 76 return True 77 else: 78 return False
174 def intersection_update(self, *others): 175 for other in others: 176 self &= other
22 def issubset(self, items): 23 JS(""" 24 for (var i in self.d) { 25 if (!items.__contains__(i)) return false; 26 } 27 return true; 28 """)
46 def intersection(self, other): 47 return IdentitySet(self._elems.intersection(other))
226 def intersection_update(self, iterable): 227 for item in set(self): 228 if item not in iterable: 229 self.remove(item)
395 def intersection_update(self, other): 396 """Update a set with the intersection of itself and another.""" 397 self &= other