Download network.py from Quadratic-Labs/PrivateNearestNeighbors-FHE: direct link, hf CLI and curl.
- Browser
- Download file 595 Bytes
-
https://huggingface.co/spaces/Quadratic-Labs/PrivateNearestNeighbors-FHE/resolve/main/network.py
- Command line
-
hf download hf://spaces/Quadratic-Labs/PrivateNearestNeighbors-FHE/network.py
-
curl -L -o network.py https://huggingface.co/spaces/Quadratic-Labs/PrivateNearestNeighbors-FHE/resolve/main/network.py
595 Bytes
| import geopandas as gpd | |
| import config | |
| import numpy | |
| def get(): | |
| all_restaurants = gpd.read_file(config.restaurants_filepath) | |
| all_restaurants = all_restaurants.dropna(subset=["name", "cuisine"]) | |
| sub_restaurants = all_restaurants.sample( | |
| config.total_restaurants_number, random_state=42 | |
| ) | |
| point_coordinates = [ | |
| list([int(point.coords[0][0]) % 10000, int(point.coords[0][1]) % 10000]) | |
| for point in sub_restaurants["geometry"].to_crs("epsg:2154") | |
| ] | |
| point_coordinates = numpy.array(point_coordinates) | |
| return sub_restaurants, point_coordinates | |