(
    fixtures: Iterable[Fixture],
)
return fixtures_to_parents, fixtures_to_children
Given an iterable of Fixtures, produce two dictionaries:
    the first maps each fixture to its parents (the fixtures it depends on);
    the second maps each fixture to its children (the fixtures that depend on it).
Given an iterable of Fixtures, produce two dictionaries:
    the first maps each fixture to its parents (the fixtures it depends on);
    the second maps each fixture to its children (the fixtures that depend on it).
Given an iterable of Fixtures produce two dictionaries : the first maps each fixture to its parents ( the fixtures it depends on ) ; the second maps each fixture to its children ( the fixtures that depend on it ) .
def fixture_parents_and_children(
    fixtures: Iterable[Fixture],
) -> Tuple[FixtureHierarchyMapping, FixtureHierarchyMapping]:
    """
    Given an iterable of Fixtures, produce two dictionaries:
    the first maps each fixture to its parents (the fixtures it depends on);
    the second maps each fixture to its children (the fixtures that depend on it).
    """
    fixtures_to_parents = {fixture: fixture.parents() for fixture in fixtures}

    # not a defaultdict, because we want to have empty entries if no parents when we return
    fixtures_to_children: Mapping[Fixture, List[Fixture]] = {
        fixture: [] for fixture in fixtures
    }
    for fixture, parents in fixtures_to_parents.items():
        for parent in parents:
            fixtures_to_children[parent].append(fixture)

    return fixtures_to_parents, fixtures_to_children
def fixture_parents_and_children ( fixtures : Iterable [ Fixture ] , ) -> Tuple [ FixtureHierarchyMapping , FixtureHierarchyMapping ] : fixtures_to_parents = { fixture : fixture . parents ( ) for fixture in fixtures } # not a defaultdict, because we want to have empty entries if no parents when we return fixtures_to_children : Mapping [ Fixture , List [ Fixture ] ] = { fixture : [ ] for fixture in fixtures } for fixture , parents in fixtures_to_parents . items ( ) : for parent in parents : fixtures_to_children [ parent ] . append ( fixture ) return fixtures_to_parents , fixtures_to_children