#NEWLINE# def _get_user_processes( ) : #NEWLINE# #INDENT# ' Gets process information owned by the current user.\n\n        Returns generator of tuples: (``psutil.Process`` instance, path).\n        ' #NEWLINE# uid = os . getuid ( ) #NEWLINE# for proc in psutil . process_iter ( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# if ( proc . uids . real == uid ) : #NEWLINE# #INDENT# ( yield ( proc , proc . exe ) ) #NEWLINE# #UNINDENT# #UNINDENT# except psutil . AccessDenied : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# path = common . which ( proc . name ) #NEWLINE# if ( ( not path ) and common . IS_MACOSX ) : #NEWLINE# #INDENT# cwd = _get_process_cwd ( proc . pid ) #NEWLINE# if ( not cwd ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# path = os . path . join ( cwd , proc . cmdline [ 0 ] ) #NEWLINE# #UNINDENT# ( yield ( proc , path ) ) #NEWLINE# #UNINDENT# except ( psutil . AccessDenied , OSError ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# except psutil . NoSuchProcess : #NEWLINE# #INDENT# pass