def _build_gremlin_insert_edges(g: GraphTraversalSource, row: pd.Series, use_header_cardinality: bool) -> GraphTraversalSource:
    g = g.V(str(row['~from'])).fold().coalesce(__.unfold(), _build_gremlin_insert_vertices(__, {'~id': row['~from'], '~label': 'Vertex'})).addE(row['~label']).property(T.id, str(row['~id'])).to(__.V(str(row['~to'])).fold().coalesce(__.unfold(), _build_gremlin_insert_vertices(__, {'~id': row['~to'], '~label': 'Vertex'})))
    g = _set_properties(g, use_header_cardinality, row)
    return g
def _build_gremlin_insert_edges(g: GraphTraversalSource, row: pd.Series, use_header_cardinality: bool) -> GraphTraversalSource:
    g = g.V(str(row['~from'])).fold().coalesce(__.unfold(), _build_gremlin_insert_vertices(__, {'~id': row['~from'], '~label': 'Vertex'})).addE(row['~label']).property(T.id, str(row['~id'])).to(__.V(str(row['~to'])).fold().coalesce(__.unfold(), _build_gremlin_insert_vertices(__, {'~id': row['~to'], '~label': 'Vertex'})))
    g = _set_properties(g, use_header_cardinality, row)
    return g