#NEWLINE# def _eval_factor( self , **hints ) : #NEWLINE# #INDENT# if ( 1 == len ( self . limits ) ) : #NEWLINE# #INDENT# summand = self . function . factor ( ** hints ) #NEWLINE# if summand . is_Mul : #NEWLINE# #INDENT# out = sift ( summand . args , ( lambda w : ( w . is_commutative and ( not ( set ( self . variables ) & w . free_symbols ) ) ) ) ) #NEWLINE# return ( Mul ( * out [ True ] ) * self . func ( Mul ( * out [ False ] ) , * self . limits ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# summand = self . func ( self . function , self . limits [ 0 : ( - 1 ) ] ) . factor ( ) #NEWLINE# if ( not summand . has ( self . variables [ ( - 1 ) ] ) ) : #NEWLINE# #INDENT# return ( self . func ( 1 , [ self . limits [ ( - 1 ) ] ] ) . doit ( ) * summand ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( summand , Mul ) : #NEWLINE# #INDENT# return self . func ( summand , self . limits [ ( - 1 ) ] ) . factor ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return self