def resolve_initial_states(self):
        """ Resolve the initial states of any unresolved nodes in the dependency graph.

        .. note::

            The resolves are done in topological order --- a consumer can assume it's dependencies
            have been resolved before it is attempted resolved.

            Since resolving a `ResourceDependency` may result in new dependencies being added to the
            dependency graph, this function keeps resolving any unresolved dependencies until there
            are no unresolved nodes left in the dependency graph.
        """
        if not networkx.is_directed_acyclic_graph(self._dependency_graph):
            e_msg = 'A dependency graph cannot contain cycles.'
            detail = 'The following cycles were piped: \n\n %s'

            cycles = networkx.simple_cycles(self._dependency_graph)
            formatted_cycles = list()
            for cycle in cycles:
                formatted_cycles.append(' -> '.join([repr(dep) for dep in cycle]))

            detail = ('\n'.join(formatted_cycles)) % detail
            raise exceptions.CircularDependencyGraph(e_msg, detail)

        while True:
            topological_sort = networkx.topological_sort(self._dependency_graph)

            unresolved_dependencies = [dependency for dependency in topological_sort if not self._dependency_graph.node[dependency]['resolved']]
            if not unresolved_dependencies:
                break

            for dependency in unresolved_dependencies:
                node_data = self._dependency_graph.node[dependency]
                if node_data.get('resolved', False):
                    continue
                node_data['resolved'] = True
                dependency.resolve_initial_state()
dataset/ETHPy150Open foundit/Piped/piped/dependencies.py/DependencyManager.resolve_initial_states/swapped operands of `%`