def legislature_to_number(leg):
 l = leg.lower().split('-')
 return ('%sLeg/%s%s' % (l[0][0:2], l[1][0], l[2][0]))

def legislature_to_number ( leg ) : l = leg . lower ( ) . split ( '-' ) return ( '%sLeg/%s%s' % ( l [ 0 ] [ 0 : 2 ] , l [ 1 ] [ 0 ] , l [ 2 ] [ 0 ] ) )
takes a full session and splits it down to the values for formatdocument .