(self, available)
return live
Mark all relevant, owned, available cases as live. Traverse incoming
        extension indexes which don't lead to closed cases, mark all touched
        cases as available.
Mark all relevant, owned, available cases as live. Traverse incoming
        extension indexes which don't lead to closed cases, mark all touched
        cases as available.
Mark all relevant owned available cases as live . Traverse incoming extension indexes which don t lead to closed cases mark all touched cases as available .
def _get_live_cases(self, available):
        """
        Mark all relevant, owned, available cases as live. Traverse incoming
        extension indexes which don't lead to closed cases, mark all touched
        cases as available.
        """
        primary_case_ids = self.primary_case_ids
        live = available & primary_case_ids
        new_live = set() | live
        checked = set()
        while new_live:
            case_to_check = new_live.pop()
            checked.add(case_to_check)
            new_live = new_live | IndexTree.get_all_outgoing_cases(
                case_to_check,
                self.index_tree,
                self.extension_index_tree
            ) - self.purged_cases
            new_live = new_live | IndexTree.traverse_incoming_extensions(
                case_to_check,
                self.extension_index_tree,
                frozenset(self.closed_cases),
            ) - self.purged_cases
            new_live = new_live - checked
            live = live | new_live

        _get_logger().debug("live cases: {}".format(live))

        return live
def _get_live_cases ( self , available ) : primary_case_ids = self . primary_case_ids live = available & primary_case_ids new_live = set ( ) | live checked = set ( ) while new_live : case_to_check = new_live . pop ( ) checked . add ( case_to_check ) new_live = new_live | IndexTree . get_all_outgoing_cases ( case_to_check , self . index_tree , self . extension_index_tree ) - self . purged_cases new_live = new_live | IndexTree . traverse_incoming_extensions ( case_to_check , self . extension_index_tree , frozenset ( self . closed_cases ) , ) - self . purged_cases new_live = new_live - checked live = live | new_live _get_logger ( ) . debug ( "live cases: {}" . format ( live ) ) return live