def make_stats(mapping):
 stats = ['Clustersize DCTB #']
 counts = defaultdict(int)
 for key in mapping.keys():
  counts[len(mapping[key])] += 1
 keys = sorted(counts.keys())
 for key in keys:
  stats.append(('%d: DCTB  DCTB %d' % ((key + 1), counts[key])))
 return '\n'.join(stats)

def make_stats ( mapping ) : stats = [ 'Clustersize DCTB #' ] counts = defaultdict ( int ) for key in mapping . keys ( ) : counts [ len ( mapping [ key ] ) ] += 1 keys = sorted ( counts . keys ( ) ) for key in keys : stats . append ( ( '%d: DCTB  DCTB %d' % ( ( key + 1 ) , counts [ key ] ) ) ) return '\n' . join ( stats )
calculates some cluster statistics .