#NEWLINE# def buildNode( provider , node , source_ref , allow_none = False ) : #NEWLINE# #INDENT# if ( ( node is None ) and allow_none ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# kind = getKind ( node ) #NEWLINE# if hasattr ( node , 'lineno' ) : #NEWLINE# #INDENT# source_ref = source_ref . atLineNumber ( node . lineno ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# source_ref = source_ref #NEWLINE# #UNINDENT# if ( kind in build_nodes_args3 ) : #NEWLINE# #INDENT# result = build_nodes_args3 [ kind ] ( provider = provider , node = node , source_ref = source_ref ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( kind in build_nodes_args2 ) : #NEWLINE# #INDENT# result = build_nodes_args2 [ kind ] ( node = node , source_ref = source_ref ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( kind in build_nodes_args1 ) : #NEWLINE# #INDENT# result = build_nodes_args1 [ kind ] ( source_ref = source_ref ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( kind == 'Pass' ) : #NEWLINE# #INDENT# result = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert False , ast . dump ( node ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( result is None ) and allow_none ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# assert isinstance ( result , NodeBase ) , result #NEWLINE# return result #NEWLINE# #UNINDENT# except SyntaxError : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# except RuntimeError : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# warning ( ( "Problem at '%s' with %s." % ( source_ref , ast . dump ( node ) ) ) ) #NEWLINE# raise