def get_file_attachments(self):
        review_request = self.get_review_request()

        def get_attachments():
            for file_attachment in self.file_attachments.all():
                file_attachment._review_request = review_request

                # Handle legacy entries which don't have an associated
                # FileAttachmentHistory entry.
                if (not file_attachment.is_from_diff and
                    file_attachment.attachment_history is None):
                    history = FileAttachmentHistory.objects.create(
                        display_position=FileAttachmentHistory
                            .compute_next_display_position(
                                review_request))

                    review_request.file_attachment_histories.add(history)

                    file_attachment.attachment_history = history
                    file_attachment.save(update_fields=['attachment_history'])

                yield file_attachment

        def get_display_position(attachment):
            if attachment.attachment_history_id is not None:
                return attachment.attachment_history.display_position
            else:
                return 0

        return sorted(list(get_attachments()),
                      key=get_display_position)
Returns a 2D array of item frequencies.  Column 1 contains item values,
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/reviews/models/base_review_request_details.py/BaseReviewRequestDetails.get_file_attachments--crossover with--dataset/ETHPy150Open radlab/sparrow/src/main/python/third_party/stats.py/aitemfreq