if len(group) > 2:
// if there are more than 2 edges here, make sure to compare all
li = group["geometry"].tolist()
li.append(li[0])
geom_pairs = list(zip(li[:-1], li[1:]))
else:
// otherwise, just compare the first edge to the second edge
geom_pairs = [(group["geometry"].iloc[0], group["geometry"].iloc[1])]
// for each pair of edges to compare
for geom1, geom2 in geom_pairs:
// if they don"t have the same geometry, flag them as different streets
After Change
for _, group in groups:
// for each pair of edges within this group
for geom1, geom2 in itertools.combinations(group["geometry"], 2):
// if they don"t have the same geometry, flag them as different streets
// add edge uvk, but not edge vuk, otherwise we"ll iterate both their keys