#NEWLINE# def __ratings_test( self ) : #NEWLINE# #INDENT# self . assertTrue ( ( len ( self . ds . ratings ) == self . __wccount ( self . ratings_file ) ) ) #NEWLINE# head_ratings = [ ( 1 , 809 , 4.0 ) , ( 1 , 601 , 5.0 ) , ( 1 , 238 , 5.0 ) , ( 1 , 664 , 4.5 ) , ( 1 , 3049 , 3.0 ) ] #NEWLINE# self . assertTrue ( ( self . ds . ratings [ 0 : 5 ] == [ ( self . ds . new_user_idx ( u ) , self . ds . new_item_idx ( i ) , r ) for ( u , i , r ) in head_ratings ] ) ) #NEWLINE# tail_ratings = [ ( 5573 , 114 , 2.5 ) , ( 5573 , 22 , 4.5 ) , ( 5573 , 11 , 3.0 ) , ( 5573 , 557 , 4.0 ) , ( 5573 , 98 , 3.5 ) ] #NEWLINE# self . assertTrue ( ( self . ds . ratings [ ( - 5 ) : ] == [ ( self . ds . new_user_idx ( u ) , self . ds . new_item_idx ( i ) , r ) for ( u , i , r ) in tail_ratings ] ) )