'Loop detection.
:param func loop_callback: A callback function for each detected loop backedge.
:return: None'

def _detect_loops(self, loop_callback=None):

    loop_finder = self.project.analyses.LoopFinder(kb=self.kb, normalize=False)
    if (loop_callback is not None):
        graph_copy = networkx.DiGraph(self._graph)
        for loop in loop_finder.loops:
            loop_callback(graph_copy, loop)
        self._graph = graph_copy
    self._loop_back_edges = list(itertools.chain.from_iterable((loop.continue_edges for loop in loop_finder.loops)))
