import requests


def get_latest_geojson(city):
    pass


def get_countries(name=None, provider=None):
    pass


def get_providers(name=None, country=None):
    pass


def get_cities(name=None, country=None, provider=None, predictable=None, active=None):
    pass


def get_stations(name=None, city=None):
    pass


def get_updates(city=None):
    pass


def get_forecast(city, station, kind, timestamp):
    pass


def get_filtered_stations(city=None, latitude=None, longitude=None, limit=None, kind=None, mode=None, timestamp=None, quantity=None):
    pass


def get_closed_city(latitude, longitude):
    pass

@@ -14,409 +14,1887 @@
 ts%0A%0A
-%0Adef get_latest_geojson(city):%0A    pass%0A%0A%0Adef get_countries(name=None, provider=None):%0A    pass%0A%0A%0Adef get_providers(name=None, country=None):%0A    pass%0A%0A%0Adef get_cities(name=None, country=None, provider=None, predictable=None, active=None):%0A    pass%0A%0A%0Adef get_stations(name=None, city=None):%0A    pass%0A%0A%0Adef get_updates(city=None):%0A    pass%0A%0A%0Adef get_forecast(city, station, kind, timestamp):%0A    pass%0A%0A
+BASE_URL = 'http://api.openbikes.co'%0A%0A%0Adef handle_connection(func):%0A    def _wrapper(*args, **kwargs):%0A        try:%0A            result = func(*args, **kwargs)%0A            assert result.status_code == requests.codes.ok%0A        except requests.exceptions.Timeout:%0A            print(%22The server has not issued a response for 'timeout' seconds%22)%0A        except requests.exceptions.ConnectionError:%0A            print(%22Refused connection or DNS failure%22)%0A        except requests.exceptions.HTTPError:%0A            print(%22Invalid HTTP response%22)%0A        except requests.exceptions.TooManyRedirects:%0A            print(%22The request exceeds the configured number of maximum redirections%22)%0A    return _wrapper%0A%0A%0A@handle_connection%0Adef get_latest_geojson(city):%0A%09url = '%7BBASE_URL%7D/geojson/'.format(BASE_URL)%0A%09res = requests.get(url, params=%7B'city': city%7D)%0A    pass%0A%0A@handle_connection%0Adef get_countries(name=None, provider=None):%0A    url = '%7BBASE_URL%7D'.format(BASE_URL)%0A    res = requests.get(url, params=%7B%7D)%0A    pass%0A%0A@handle_connection%0Adef get_providers(name=None, country=None):%0A    url = '%7BBASE_URL%7D'.format(BASE_URL)%0A    res = requests.get(url, params=%7B%7D)%0A    pass%0A%0A@handle_connection%0Adef get_cities(name=None, country=None, provider=None, predictable=None, active=None):%0A    url = '%7BBASE_URL%7D'.format(BASE_URL)%0A    res = requests.get(url, params=%7B%7D)%0A    pass%0A%0A@handle_connection%0Adef get_stations(name=None, city=None):%0A    url = '%7BBASE_URL%7D'.format(BASE_URL)%0A    res = requests.get(url, params=%7B%7D)%0A    pass%0A%0A@handle_connection%0Adef get_updates(city=None):%0A    url = '%7BBASE_URL%7D'.format(BASE_URL)%0A    res = requests.get(url, params=%7B%7D)%0A    pass%0A%0A@handle_connection%0Adef get_forecast(city, station, kind, timestamp):%0A    url = '%7BBASE_URL%7D'.format(BASE_URL)%0A    res = requests.get(url, params=%7B'city': city, 'station':station, 'kind':kind, 'timestamp':timestamp%7D%0A    pass%0A%0A@handle_connection
 %0Adef
@@ -2028,22 +2028,119 @@
 e):%0A    
-pass%0A%0A
+url = '%7BBASE_URL%7D'.format(BASE_URL)%0A    res = requests.get(url, params=%7B%7D)%0A    pass%0A%0A@handle_connection
 %0Adef get
@@ -2145,17 +2145,18 @@
 et_close
-d
+st
 _city(la
@@ -2171,21 +2171,142 @@
 longitude):%0A
+    url = '%7BBASE_URL%7D'.format(BASE_URL)%0A    res = requests.get(url, params=%7B'latitude': latitude, 'longitude':longitude%7D%0A
     pass%0A

add base_url, decorator to handle requests exceptions