#NEWLINE# def project_partitioning( columnlist , input_partitioning ) : #NEWLINE# #INDENT# 'Return the partitioning for a simple projection that supports\n    duplicates, swapping, and removal' #NEWLINE# if ( input_partitioning . hash_partitioned <= frozenset ( columnlist ) ) : #NEWLINE# #INDENT# newrefs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( newi , old ) in [ ( newi , newrefs ) for ( newi , old ) in enumerate ( columnlist ) if ( old in input_partitioning . hash_partitioned ) ] : #NEWLINE# #INDENT# if ( old not in newrefs ) : #NEWLINE# #INDENT# newrefs [ old ] = newi #NEWLINE# #UNINDENT# #UNINDENT# return RepresentationProperties ( hash_partitioned = frozenset ( ( expression . UnnamedAttributeRef ( i ) for i in newrefs . values ( ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return RepresentationProperties ( )