lifecycles.LifeCycle.get_element_membership

LifeCycle.get_element_membership(element: object) list

retrieve the list of groups that contain a given element

Parameters:

element – the element for which to retrieve the memberships

Returns:

a list of group names that contain the given element

Example:

>>> lc = LifeCycle()
>>> lc.add_partition([[1,2], [3,4,5]])
>>> lc.add_partition([[1,2,3], [4,5]])
>>> lc.get_element_membership(1)
>>> # ['0_0', '1_0']