#NEWLINE# def category_join_reducer( self , business_id , reviews_or_categories ) : #NEWLINE# #INDENT# 'Take in business_id, ((review text and rating) or category information), emit\n        category, (biz_id, (review, rating)).\n        ' #NEWLINE# categories = None #NEWLINE# reviews = [ ] #NEWLINE# for ( data_type , data ) in reviews_or_categories : #NEWLINE# #INDENT# if ( data_type == 'review' ) : #NEWLINE# #INDENT# reviews . append ( data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# categories = category #NEWLINE# #UNINDENT# #UNINDENT# if ( not categories ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# for category in categories : #NEWLINE# #INDENT# for review_positivity in reviews : #NEWLINE# #INDENT# ( yield ( category , ( business_id , review_positivity ) ) )