@@ -0,0 +1,1374 @@
+#!/usr/bin/env python%0A%0Afrom pymongo import Connection%0Aimport operator%0A%0Adef run():%0A    db = Connection().regulations%0A    %0A    data = list(db.docs.find())%0A    doc_count = len(data)%0A    print 'Total document count: %25s' %25 doc_count%0A    %0A    all_downloaded = %5Bitem for item in data if reduce(operator.and_, %5Bview%5B'Downloaded'%5D for view in item%5B'Views'%5D if 'Downloaded' in view%5D, True)%5D%0A    none_downloaded = %5Bitem for item in data if reduce(operator.and_, %5Bnot view%5B'Downloaded'%5D for view in item%5B'Views'%5D if 'Downloaded' in view%5D, True)%5D%0A    all_decoded = %5Bitem for item in data if reduce(operator.and_, %5Bview%5B'Decoded'%5D for view in item%5B'Views'%5D if 'Decoded' in view%5D, True)%5D%0A    none_decoded = %5Bitem for item in data if reduce(operator.and_, %5Bnot view%5B'Decoded'%5D for view in item%5B'Views'%5D if 'Decoded' in view%5D, True)%5D%0A    %0A    print 'Documents where all views were downloaded: %25s' %25 len(all_downloaded)%0A    print 'Documents where no views were downloaded: %25s' %25 len(none_downloaded)%0A    print 'Documents where all downloaded views were decoded: %25s' %25 len(all_decoded)%0A    print 'Documents where no downloaded views were decoded: %25s' %25 len(none_decoded)%0A    %0A    nd_content_types = set(reduce(operator.add, %5B%5Bview%5B'Type'%5D for view in doc%5B'Views'%5D%5D for doc in none_decoded%5D))%0A    print 'Content types present in views of non-decoded documents: %25s' %25 ', '.join(nd_content_types)

Add some basic stats to help judge run quality.