def _build_gremlin_insert_vertices(g: GraphTraversalSource, row: Any, use_header_cardinality: bool=False) -> GraphTraversalSource:
    g = g.V(str(row['~id'])).fold().coalesce(__.unfold(), __.addV(row['~label']).property(T.id, str(row['~id'])))
    g = _set_properties(g, use_header_cardinality, row)
    return g
def _build_gremlin_insert_vertices(g: GraphTraversalSource, row: Any, use_header_cardinality: bool=False) -> GraphTraversalSource:
    g = g.V(str(row['~id'])).fold().coalesce(__.unfold(), __.addV(row['~label']).property(T.id, str(row['~id'])))
    g = _set_properties(g, use_header_cardinality, row)
    return g