def partition_by(inputs, attribute):
 return group_by(inputs, (lambda x: x[0][attribute]))

def partition_by ( inputs , attribute ) : return group_by ( inputs , ( lambda x : x [ 0 ] [ attribute ] ) )
returns a dict of inputs partitioned by the attribute each input is a pair .