def _collect_box_count(self, boxes):
count = Counter([box.box_id for box in boxes])<EOL>for box in boxes:<EOL><INDENT>if hasattr(box, '<STR_LIT>'):<EOL><INDENT>count.update(self._collect_box_count(box.box))<EOL><DEDENT><DEDENT>return count<EOL>
Count the occurences of each box type.