def extract_modes(spans):
 rangelen = sorted([((x['to'] - x['from']) + 1) for x in spans])
 deflen = sorted(rangelen, key=rangelen.count)[(-1)]
 reprs = [str2fmt(x['str']) for x in spans]
 deffmt = sorted(reprs, key=reprs.count)[(-1)]
 return (deflen, deffmt)

def extract_modes ( spans ) : rangelen = sorted ( [ ( ( x [ 'to' ] - x [ 'from' ] ) + 1 ) for x in spans ] ) deflen = sorted ( rangelen , key = rangelen . count ) [ ( - 1 ) ] reprs = [ str2fmt ( x [ 'str' ] ) for x in spans ] deffmt = sorted ( reprs , key = reprs . count ) [ ( - 1 ) ] return ( deflen , deffmt )
extract the most common spans lengths and representation formats .