def to_directed(self):
        from networkx import DiGraph
        G=DiGraph()
        G.name=self.name
        G.add_nodes_from(self)
        G.add_edges_from( ((u,v,deepcopy(data))
                           for u,nbrs in self.adjacency_iter()
                           for v,data in nbrs.items()) )
        G.graph=deepcopy(self.graph)
        G.node=deepcopy(self.node)
        return G
Set up a full entity component.
dataset/ETHPy150Open networkx/networkx/networkx/classes/tests/timingclasses.py/TimingGraph.to_directed--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/helpers/entity_component.py/EntityComponent.setup