#NEWLINE# def _is_finite_with_finite_vars( f , domain = S . Complexes ) : #NEWLINE# #INDENT# "\n    Return True if the given expression is finite. For symbols that\n    don't assign a value for `complex` and/or `real`, the domain will\n    be used to assign a value; symbols that don't assign a value\n    for `finite` will be made finite. All other assumptions are\n    left unmodified.\n    " #NEWLINE# def assumptions( s ) : #NEWLINE# #INDENT# A = s . assumptions0 #NEWLINE# if ( A . get ( 'finite' , None ) is None ) : #NEWLINE# #INDENT# A [ 'finite' ] = True #NEWLINE# #UNINDENT# A . setdefault ( 'complex' , True ) #NEWLINE# A . setdefault ( 'real' , domain . is_subset ( S . Reals ) ) #NEWLINE# return A #NEWLINE# #UNINDENT# reps = { f : Dummy ( ** assumptions ( s ) ) for s in f . free_symbols } #NEWLINE# return f . xreplace ( reps ) . is_finite