MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _cloned_intersection

Function _cloned_intersection

lib/sqlalchemy/sql/base.py:358–368  ·  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

356
357
358def _cloned_intersection(a: Iterable[_CLE], b: Iterable[_CLE]) -> Set[_CLE]:
359 """return the intersection of sets a and b, counting
360 any overlap between 'cloned' predecessors.
361
362 The returned set is in terms of the entities present within 'a'.
363
364 """
365 all_overlap: Set[_CLE] = set(_expand_cloned(a)).intersection(
366 _expand_cloned(b)
367 )
368 return {elem for elem in a if all_overlap.intersection(elem._cloned_set)}
369
370
371def _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