(self, relevant)
return available
Mark all relevant cases that are open and have no outgoing extension indexes
        as available. Traverse incoming extension indexes which don't lead to closed
        cases, mark all touched cases as available
Mark all relevant cases that are open and have no outgoing extension indexes
        as available. Traverse incoming extension indexes which don't lead to closed
        cases, mark all touched cases as available
Mark all relevant cases that are open and have no outgoing extension indexes as available . Traverse incoming extension indexes which don t lead to closed cases mark all touched cases as available
def _get_available_cases(self, relevant):
        """
        Mark all relevant cases that are open and have no outgoing extension indexes
        as available. Traverse incoming extension indexes which don't lead to closed
        cases, mark all touched cases as available
        """
        incoming_extensions = self.extension_index_tree.reverse_indices
        available = {case for case in relevant
                     if case not in self.closed_cases
                     and (not self.extension_index_tree.indices.get(case) or self.index_tree.indices.get(case))}
        new_available = set() | available
        while new_available:
            case_to_check = new_available.pop()
            for incoming_extension in incoming_extensions.get(case_to_check, []):
                closed = incoming_extension in self.closed_cases
                purged = incoming_extension in self.purged_cases
                if not closed and not purged:
                    new_available.add(incoming_extension)
            available = available | new_available
        _get_logger().debug("Available cases: {}".format(available))

        return available
def _get_available_cases ( self , relevant ) : incoming_extensions = self . extension_index_tree . reverse_indices available = { case for case in relevant if case not in self . closed_cases and ( not self . extension_index_tree . indices . get ( case ) or self . index_tree . indices . get ( case ) ) } new_available = set ( ) | available while new_available : case_to_check = new_available . pop ( ) for incoming_extension in incoming_extensions . get ( case_to_check , [ ] ) : closed = incoming_extension in self . closed_cases purged = incoming_extension in self . purged_cases if not closed and not purged : new_available . add ( incoming_extension ) available = available | new_available _get_logger ( ) . debug ( "Available cases: {}" . format ( available ) ) return available