def generate_additional_context(self, matching_datasets):
        """Return context about matching datasets."""
        related_tags = Tag.objects.filter(
            dataset__in=matching_datasets
        ).distinct().annotate(
            Count('word')
        ).order_by('-word__count')[:5]

        return {
            'related_tags': related_tags
        }
def generate_additional_context ( self , matching_datasets ) : related_tags = Tag . objects . filter ( dataset__in = matching_datasets ) . distinct ( ) . annotate ( Count ( 'word' ) ) . order_by ( '-word__count' ) [ : 5 ] return { 'related_tags' : related_tags }
Return context about matching datasets.