def _forward_entity_paths(self, start_entity_id, seen_entities=None):
    '\n        Generator which yields the ids of all entities connected through forward\n        relationships, and the path taken to each. An entity will be yielded\n        multiple times if there are multiple paths to it.\n\n        Implemented using depth first search.\n        '
    if (seen_entities is None):
        seen_entities = set()
    if (start_entity_id in seen_entities):
        return
    seen_entities.add(start_entity_id)
    (yield (start_entity_id, []))
    for relationship in self.get_forward_relationships(start_entity_id):
        next_entity = relationship.parent_entity.id
        descendants = self._forward_entity_paths(next_entity, seen_entities.copy())
        for (sub_entity_id, sub_path) in descendants:
            (yield (sub_entity_id, ([relationship] + sub_path)))
Generator which yields the ids of all entities connected through forward
relationships, and the path taken to each. An entity will be yielded
multiple times if there are multiple paths to it.

Implemented using depth first search.
def _forward_entity_paths(self, start_entity_id, seen_entities=None):
    '\n        Generator which yields the ids of all entities connected through forward\n        relationships, and the path taken to each. An entity will be yielded\n        multiple times if there are multiple paths to it.\n\n        Implemented using depth first search.\n        '
    if (seen_entities is None):
        seen_entities = set()
    if (start_entity_id in seen_entities):
        return
    seen_entities.add(start_entity_id)
    (yield (start_entity_id, []))
    for relationship in self.get_forward_relationships(start_entity_id):
        next_entity = relationship.parent_entity.id
        descendants = self._forward_entity_paths(next_entity, seen_entities.copy())
        for (sub_entity_id, sub_path) in descendants:
            (yield (sub_entity_id, ([relationship] + sub_path)))