def _set_properties(g: GraphTraversalSource, use_header_cardinality: bool, row: Any) -> GraphTraversalSource:
    for (column, value) in row.items():
        if (column not in ['~id', '~label', '~to', '~from']):
            if use_header_cardinality:
                if ((column.lower().find('(single)') > 0) and pd.notna(value)):
                    g = g.property(Cardinality.single, _get_column_name(column), value)
                else:
                    g = _expand_properties(g, _get_column_name(column), value)
            else:
                g = _expand_properties(g, column, value)
    return g
def _set_properties(g: GraphTraversalSource, use_header_cardinality: bool, row: Any) -> GraphTraversalSource:
    for (column, value) in row.items():
        if (column not in ['~id', '~label', '~to', '~from']):
            if use_header_cardinality:
                if ((column.lower().find('(single)') > 0) and pd.notna(value)):
                    g = g.property(Cardinality.single, _get_column_name(column), value)
                else:
                    g = _expand_properties(g, _get_column_name(column), value)
            else:
                g = _expand_properties(g, column, value)
    return g