def find_cycle(targets):
    """
    Given a dict representing a target dependency graph, return a list of any
    nodes involved in a dependency cycle.  Returns the first cycle found.
    """
    todo = set(targets.keys())
    while todo:
        node = todo.pop()
        stack = [node]
        while stack:
            top = stack[-1]
            for node in targets[top]:
                if node in stack:
                    return stack[stack.index(node):]
                if node in todo:
                    stack.append(node)
                    todo.remove(node)
                    break
            else:
                node = stack.pop()
    return None
