benchmarks.wiki / Public workspace
BigCodeBench / BigCodeBench v0.1.0_hf 9c6eb126-96d2-5567-abb1-8aa778ea4375
Problem
Answer published by the source. Consult the official source to check your work against its answer.
complete prompt
from geopy.distance import geodesic
import folium
def task_func(dic):
"""
Generates a Folium map with markers for specified locations and calculates the geodesic
distances between each pair of locations.
Parameters:
dic (dict): A dictionary with location names as keys and their latitudes and longitudes
as values (e.g., {'Location': {'Lat': latitude, 'Lon': longitude}}).
Returns:
tuple: A tuple containing a Folium map object and a dictionary with pairs of location
names as keys and their distances in kilometers as values.
Raises:
ValueError: If the input dictionary is empty.
Requirements:
- geopy.distance.geodesic
- folium
Examples:
>>> result = task_func({'Place1': {'Lat': 0, 'Lon': 0}, 'Place2': {'Lat': 0, 'Lon': 1}})
>>> isinstance(result, tuple) and len(result) == 2
True
>>> isinstance(result[0], folium.folium.Map) and isinstance(result[1], dict)
True
"""
instruct prompt
Generates a Folium map with markers for specified locations and calculates the geodesic distances between each pair of locations.
The function should raise the exception for: ValueError: If the input dictionary is empty.
The function should output with:
tuple: A tuple containing a Folium map object and a dictionary with pairs of location
names as keys and their distances in kilometers as values.
You should write self-contained code starting with:
Code
from geopy.distance import geodesic
import folium
def task_func(dic):
code prompt
Code
from geopy.distance import geodesic
import folium
def task_func(dic):
entry point
task_func
libs
- geopy
- folium
Discussion
No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.
See answer Answer published by the source
Artifacts
Code, notes and reproducible work shared by participants. Files are served from a separate origin.
No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.
Source and history
initial import