Example #1
0
 def MakeAnnotated(
         self,
         n: Optional[int] = None
 ) -> data_flow_graphs.NetworkxDataFlowGraphs:
     g = programl.ProgramGraphToNetworkX(self.unlabelled_graph)
     return data_flow_graphs.NetworkxDataFlowGraphs(
         [g for _ in range(n or 1)])
Example #2
0
    def MakeAnnotated(
            self,
            n: Optional[int] = None
    ) -> data_flow_graphs.NetworkxDataFlowGraphs:
        if random.random() < 0.2:
            raise OSError("something went wrong!")

        g = programl.ProgramGraphToNetworkX(self.unlabelled_graph)
        return data_flow_graphs.NetworkxDataFlowGraphs(
            [g for _ in range(n or 1)])
Example #3
0
 def MakeAnnotated(self,
                   n: int = 0) -> data_flow_graphs.NetworkxDataFlowGraphs:
     return data_flow_graphs.NetworkxDataFlowGraphs([])
Example #4
0
 def MakeAnnotated(
         self,
         n: Optional[int] = None
 ) -> data_flow_graphs.NetworkxDataFlowGraphs:
     time.sleep(self.seconds)
     return data_flow_graphs.NetworkxDataFlowGraphs([])