dump the row stats
(idx, row)
| 80 | fh.write(item) |
| 81 | |
| 82 | def dump_example_shapes(idx, row): |
| 83 | """ dump the row stats """ |
| 84 | shapes = {} |
| 85 | |
| 86 | img = row["image"] |
| 87 | shapes["image"] = 0 if img is None else "x".join(map(str, img.size)) |
| 88 | |
| 89 | for col in ['meta', 'source', 'text']: |
| 90 | item = row[col] |
| 91 | shapes[col] = 0 if item is None else len(item) |
| 92 | |
| 93 | summary = ", ".join([f"{k}: {v:>9}" for k,v in shapes.items()]) |
| 94 | print(f"rec{idx:>6}: {summary}") |
| 95 | |
| 96 | |
| 97 | ids_range = list2range(args.ids) |
no test coverage detected