def extend_year_spans(spans, spanlen, start=1900, end=2014):
 extended_spans = spans[:]
 for (x, y) in pairwise(spans):
  for span_from in range((x['to'] + 1), y['from'], spanlen):
   extended_spans.append({'from': span_from})
 for span_from in range((spans[0]['from'] - spanlen), start, (- spanlen)):
  extended_spans.append({'from': span_from})
 for span_from in range((spans[(-1)]['to'] + 1), end, spanlen):
  extended_spans.append({'from': span_from})
 complete_year_spans(extended_spans)
 return extended_spans

def extend_year_spans ( spans , spanlen , start = 1900 , end = 2014 ) : extended_spans = spans [ : ] for ( x , y ) in pairwise ( spans ) : for span_from in range ( ( x [ 'to' ] + 1 ) , y [ 'from' ] , spanlen ) : extended_spans . append ( { 'from' : span_from } ) for span_from in range ( ( spans [ 0 ] [ 'from' ] - spanlen ) , start , ( - spanlen ) ) : extended_spans . append ( { 'from' : span_from } ) for span_from in range ( ( spans [ ( - 1 ) ] [ 'to' ] + 1 ) , end , spanlen ) : extended_spans . append ( { 'from' : span_from } ) complete_year_spans ( extended_spans ) return extended_spans
add new spans to given spans list so that every year of [start .