In this stackoverflow question a suggestion was made to use the query supplied in the first answer to do a particular gremlin_python traversal. Namely
g.V().has('name', 'USA').limit(1000).hasLabel('Country').
map(union(project('id','label').
by(id).
by(label),
valueMap()).unfold().
group().
by(keys).
by(select(values)))
I am able to import all but "keys" from the gremlin_python graph traversal library like the following
from gremlin_python.process.graph_traversal import union, project, valueMap, select, key, values, id, label, map
Looking at the gremlin_python repo, I don't see a way to define the portion that is "by(keys)"
Does anyone know how this can be accomplished?