(data, sizes, samples_by_type, write)
report on number of new blobs by blob bucket
report on number of new blobs by blob bucket
report on number of new blobs by blob bucket
def report_blobs_by_type(data, sizes, samples_by_type, write):
    """report on number of new blobs by blob bucket"""
    assert len(data) < 100, len(data)
    bucket_missing = defaultdict(int)
    type_missing = defaultdict(int)
    for domain_sizes in sizes.values():
        for size in domain_sizes:
            if size.length is UNKNOWN:
                bucket_missing[size.bucket] += 1
                type_missing[size.doc_type] += 1
    write(["BUCKET", "BLOB COUNT", "NOT FOUND"])
    for bucket, key_list in sorted(data.items()):
        if bucket not in samples_by_type:
            continue
        write([bucket, len(key_list), bucket_missing.get(bucket, "")])
        for doc_type, n_samples in sorted(samples_by_type[bucket].items()):
            write(["  " + doc_type, n_samples, type_missing.get(doc_type, "")])
    write([])
def report_blobs_by_type ( data , sizes , samples_by_type , write ) : assert len ( data ) < 100 , len ( data ) bucket_missing = defaultdict ( int ) type_missing = defaultdict ( int ) for domain_sizes in sizes . values ( ) : for size in domain_sizes : if size . length is UNKNOWN : bucket_missing [ size . bucket ] += 1 type_missing [ size . doc_type ] += 1 write ( [ "BUCKET" , "BLOB COUNT" , "NOT FOUND" ] ) for bucket , key_list in sorted ( data . items ( ) ) : if bucket not in samples_by_type : continue write ( [ bucket , len ( key_list ) , bucket_missing . get ( bucket , "" ) ] ) for doc_type , n_samples in sorted ( samples_by_type [ bucket ] . items ( ) ) : write ( [ "  " + doc_type , n_samples , type_missing . get ( doc_type , "" ) ] ) write ( [ ] )