##### nile.py

```
from math import sin, cos, atan2, sqrt
def get_distance(from_lat, from_long, to_lat, to_long):
dlon = to_long - from_long
dlat = from_lat - to_lat
a = (sin(dlat/2)) ** 2 + cos(from_lat) * cos(to_lat) * (sin(dlon/2)) ** 2
c = 2 * atan2(sqrt(a), sqrt(1-a))
distance = a * c
return distance
```

This file has been truncated. show original
##### script.py

```
from nile import get_distance, format_price, SHIPPING_PRICES
from test import test_function
# Define calculate_shipping_cost() here:
def calculate_shipping_cost(from_coords, to_coords, shipping_type = 'Overnight'):
distance = get_distance(*from_coords, *to_coords)
shipping_rate = SHIPPING_PRICES[shipping_type]
price = distance*shipping_rate
return format_price(price)
```

This file has been truncated. show original
##### test.py

```
def test_function(fn):
if fn.__name__ == "calculate_shipping_cost":
test_shipping(fn)
if fn.__name__ == "calculate_driver_cost":
test_driver(fn)
if fn.__name__ == "calculate_money_made":
test_money(fn)
def test_shipping(f):
try:
```

This file has been truncated. show original