def _remove_nonjoin_identity_nodes(graph, keep_iterables=False):
 for node in _identity_nodes(graph, (not keep_iterables)):
  if (not hasattr(node, u'joinsource')):
   _remove_identity_node(graph, node)
 return graph

def _remove_nonjoin_identity_nodes ( graph , keep_iterables = False ) : for node in _identity_nodes ( graph , ( not keep_iterables ) ) : if ( not hasattr ( node , u'joinsource' ) ) : _remove_identity_node ( graph , node ) return graph
remove non-join identity nodes from the given graph iterable nodes are retained if and only if the keep_iterables flag is set to true .