#NEWLINE# def mask_adjacency_array( mask , adjacency_array ) : #NEWLINE# #INDENT# indices_to_remove = np . nonzero ( ( ~ mask ) ) [ 0 ] #NEWLINE# entries_to_remove = np . in1d ( adjacency_array , indices_to_remove ) #NEWLINE# entries_to_remove = entries_to_remove . reshape ( [ ( - 1 ) , adjacency_array . shape [ 1 ] ] ) #NEWLINE# indices_to_keep = ( ~ entries_to_remove . any ( axis = 1 ) ) #NEWLINE# return adjacency_array [ indices_to_keep , : ]