#NEWLINE# @ classmethod #NEWLINE# def eval( cls , nu , z ) : #NEWLINE# #INDENT# from sympy import unpolarify , expand_mul , uppergamma , exp , gamma , factorial #NEWLINE# nu2 = unpolarify ( nu ) #NEWLINE# if ( nu != nu2 ) : #NEWLINE# #INDENT# return expint ( nu2 , z ) #NEWLINE# #UNINDENT# if ( ( nu . is_Integer and ( nu <= 0 ) ) or ( ( not nu . is_Integer ) and ( 2 * nu ) . is_Integer ) ) : #NEWLINE# #INDENT# return unpolarify ( expand_mul ( ( ( z ** ( nu - 1 ) ) * uppergamma ( ( 1 - nu ) , z ) ) ) ) #NEWLINE# #UNINDENT# ( z , n ) = z . extract_branch_factor ( ) #NEWLINE# if ( n == 0 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if nu . is_integer : #NEWLINE# #INDENT# if ( ( nu > 0 ) != True ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# return ( expint ( nu , z ) - ( ( ( ( ( ( 2 * pi ) * I ) * n ) * ( ( - 1 ) ** ( nu - 1 ) ) ) / factorial ( ( nu - 1 ) ) ) * ( unpolarify ( z ) ** ( nu - 1 ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( ( ( ( exp ( ( ( ( ( 2 * I ) * pi ) * nu ) * n ) ) - 1 ) * ( z ** ( nu - 1 ) ) ) * gamma ( ( 1 - nu ) ) ) + expint ( nu , z ) )