code: def get_nearest_edge(G, point):
      start_time = time.time()
      gdf = graph_to_gdfs(G, nodes=False, fill_edge_geometry=True)
      graph_edges = gdf[["geometry", "u", "v"]].values.tolist()
      edges_with_distances = [
          (
              graph_edge,
              Point(tuple(reversed(point))).distance(graph_edge[0])
          )
          for graph_edge in graph_edges
      ]
      edges_with_distances = sorted(edges_with_distances, key=lambda x: x[1])
      closest_edge_to_point = edges_with_distances[0][0]
      geometry, u, v = closest_edge_to_point
      log('Found nearest edge ({}) to point {} in {:,.2f} seconds'.format((u, v), point, time.time() - start_time))
      return geometry, u, v