#NEWLINE# def get_columns( self , node , ctx ) : #NEWLINE# #INDENT# '\n        returns the sub-set of columns in the dataframe returned\n        by get_dataframe that relate to a particular node\n        ' #NEWLINE# ctx_id = ( ctx if isinstance ( ctx , int ) else ctx . get_id ( ) ) #NEWLINE# try : #NEWLINE# #INDENT# return self . _cached_columns [ ( ctx_id , node ) ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# handler_dict = self . context_handler_dict [ ctx_id ] #NEWLINE# columns = [ ] #NEWLINE# ctx_ids = [ ] #NEWLINE# for ( ( node_name , short_name , sub_ctx_id ) , handler ) in handler_dict . items ( ) : #NEWLINE# #INDENT# if ( ( node_name == node . name ) and ( short_name == node . short_name ) ) : #NEWLINE# #INDENT# columns . append ( handler . get_columns ( ) ) #NEWLINE# ctx_ids . append ( sub_ctx_id ) #NEWLINE# #UNINDENT# #UNINDENT# columns = _relabel ( columns , ( [ node . name ] * len ( columns ) ) , ( [ node . short_name ] * len ( columns ) ) , ctx_ids ) #NEWLINE# return reduce ( operator . add , columns , [ ] )