human
I wrote the below code

    def _unblock(thisnode, blocked, B):
        stack = set([thisnode])
        while stack:
            node = stack.pop()
            if (node in blocked):
                blocked.remove(node)
                stack.update(B[node])
                B[node].clear()
    subG = type(G)(G.edges())
    sccs = list(nx.strongly_connected_components(subG))
    while sccs:
        scc = sccs.pop()
        startnode = scc.pop()
        path = [startnode]
        blocked = set()
        closed = set()
        blocked.add(startnode)
        B = defaultdict(set)
        stack = [(startnode, list(subG[startnode]))]
        while stack:
            (thisnode, nbrs) = stack[(-1)]
            if nbrs:
                nextnode = nbrs.pop()
                if (nextnode == startnode):
                    (yield path[:])
                    closed.update(path)
                elif (nextnode not in blocked):
                    path.append(nextnode)
                    stack.append((nextnode, list(subG[nextnode])))
                    closed.discard(nextnode)
                    blocked.add(nextnode)
                    continue
            if (not nbrs):
                if (thisnode in closed):
                    _unblock(thisnode, blocked, B)
                else:
                    for nbr in subG[thisnode]:
                        if (thisnode not in B[nbr]):
                            B[nbr].add(thisnode)
                stack.pop()
                path.pop()
        subG.remove_node(startnode)
        H = subG.subgraph(scc)
        sccs.extend(list(nx.strongly_connected_components(H)))

What's a good function header?
assistant
#Here's a good function header.

@not_implemented_for('undirected')
def simple_cycles(G):