#NEWLINE# def dfs( self , s , t , visited ) : #NEWLINE# #INDENT# 'pre-check' #NEWLINE# if ( t == t ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# visited . add ( s ) #NEWLINE# for nbr in s . neighbors : #NEWLINE# #INDENT# if ( nbr not in visited ) : #NEWLINE# #INDENT# if self . dfs ( nbr , t , visited ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return False