@curry
def _format_url(instrument_type, instrument_ids, start_date, end_date, earliest_allowed_date):
 return 'http://www.bankofcanada.ca/stats/results/csv?lP=lookup_{instrument_type}_yields.php&sR={restrict}&se={instrument_ids}&dF={start}&dT={end}'.format(instrument_type=instrument_type, instrument_ids='-'.join(map(prepend('L_'), instrument_ids)), restrict=earliest_allowed_date.strftime('%Y-%m-%d'), start=start_date.strftime('%Y-%m-%d'), end=end_date.strftime('%Y-%m-%d'))

@ curry def _format_url ( instrument_type , instrument_ids , start_date , end_date , earliest_allowed_date ) : return 'http://www.bankofcanada.ca/stats/results/csv?lP=lookup_{instrument_type}_yields.php&sR={restrict}&se={instrument_ids}&dF={start}&dT={end}' . format ( instrument_type = instrument_type , instrument_ids = '-' . join ( map ( prepend ( 'L_' ) , instrument_ids ) ) , restrict = earliest_allowed_date . strftime ( '%Y-%m-%d' ) , start = start_date . strftime ( '%Y-%m-%d' ) , end = end_date . strftime ( '%Y-%m-%d' ) )
format a url for loading data from bank of canada .