code: def roots(g):
      "Get nodes from graph G with indegree 0"
      return set(n for n, d in iteritems(g.in_degree()) if d == 0f roots(g):
      "Get nodes from graph G with indegree 0"
      return set(n for n, d in iteritems(g.in_degree()) if d == 0)
docs: Get nodes from graph G with indegree 0