def _is_duplicate_edge(data1: dict[str, Any], data2: dict[str, Any]) -> bool:
    """
    Check if two graph edge data dicts have the same `osmid` and `geometry`.

    Parameters
    ----------
    data1
        The first edge's attribute data.
    data2
        The second edge's attribute data.

    Returns
    -------
    is_dupe
        True if `osmid` and `geometry` are the same, otherwise False.
    """
    is_dupe = False

    # if either edge's osmid contains multiple values (due to simplification)
    # compare them as sets to see if they contain the same values
    osmid1 = set(data1["osmid"]) if isinstance(data1["osmid"], list) else data1["osmid"]
    osmid2 = set(data2["osmid"]) if isinstance(data2["osmid"], list) else data2["osmid"]

    # if they contain the same osmid or set of osmids (due to simplification)
    if osmid1 == osmid2:
        # if both edges have geometry attributes and they match each other
        if ("geometry" in data1) and ("geometry" in data2):
            if _is_same_geometry(data1["geometry"], data2["geometry"]):
                is_dupe = True

        # if neither edge has a geometry attribute
        elif ("geometry" not in data1) and ("geometry" not in data2):
            is_dupe = True

        # if one edge has geometry attribute but the other doesn't: not dupes
        else:
            pass

    return is_dupe

    Check if two graph edge data dicts have the same `osmid` and `geometry`.

    Parameters
    ----------
    data1
        The first edge's attribute data.
    data2
        The second edge's attribute data.

    Returns
    -------
    is_dupe
        True if `osmid` and `geometry` are the same, otherwise False.
    
osmnx/convert.py