def get_cs_bytes(td, fds):
    count = 0
    for cs in td.GlobalSubrs:
        count += len(cs.bytecode)
    for fd in fds:
        try:
            for cs in fd.Private.Subrs:
                count += len(cs.bytecode)
        except __HOLE__:
            pass
    for cs in td.CharStrings.values():
        count += len(cs.bytecode)
    return count
dataset/ETHPy150Open googlei18n/compreffor/tools/subr_grapher.py/get_cs_bytes