MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _cloned_intersection

Function _cloned_intersection

lib/sqlalchemy/sql/base.py:346–356  ·  view source on GitHub ↗

return the intersection of sets a and b, counting any overlap between 'cloned' predecessors. The returned set is in terms of the entities present within 'a'.

(a: Iterable[_CLE], b: Iterable[_CLE])

Source from the content-addressed store, hash-verified

344
345
346def _cloned_intersection(a: Iterable[_CLE], b: Iterable[_CLE]) -> Set[_CLE]:
347 """return the intersection of sets a and b, counting
348 any overlap between 'cloned' predecessors.
349
350 The returned set is in terms of the entities present within 'a'.
351
352 """
353 all_overlap: Set[_CLE] = set(_expand_cloned(a)).intersection(
354 _expand_cloned(b)
355 )
356 return {elem for elem in a if all_overlap.intersection(elem._cloned_set)}
357
358
359def _cloned_difference(a: Iterable[_CLE], b: Iterable[_CLE]) -> Set[_CLE]:

Callers 1

_get_display_fromsMethod · 0.85

Calls 2

_expand_clonedFunction · 0.85
intersectionMethod · 0.45

Tested by

no test coverage detected