#NEWLINE# def run_as_package_path( self ) : #NEWLINE# #INDENT# 'Runs program as package specified with file path.' #NEWLINE# import runpy #NEWLINE# pkg_code = base_profile . get_package_code ( self . _run_object , name_is_path = True ) #NEWLINE# with CodeHeatmapCalculator ( ) as prof : #NEWLINE# #INDENT# for ( _ , compiled_code ) in pkg_code . values ( ) : #NEWLINE# #INDENT# prof . add_code ( compiled_code ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# runpy . run_path ( self . _run_object ) #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# raise CodeHeatmapRunError ( ( 'Unable to run package %s' % self . _run_object ) ) #NEWLINE# #UNINDENT# except SystemExit : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return self . _consodalidate_stats ( pkg_code , prof )