def coalesce_table_labels(attributes, onrows, oncolumns):
 if ((not onrows) or (not oncolumns)):
  onrows = (onrows or [])
  oncolumns = (oncolumns or [])
  if (not onrows):
   onrows = [attr for attr in attributes if (attr not in oncolumns)]
  if (not oncolumns):
   oncolumns = [attr for attr in attributes if (attr not in onrows)]
 return (onrows, oncolumns)

def coalesce_table_labels ( attributes , onrows , oncolumns ) : if ( ( not onrows ) or ( not oncolumns ) ) : onrows = ( onrows or [ ] ) oncolumns = ( oncolumns or [ ] ) if ( not onrows ) : onrows = [ attr for attr in attributes if ( attr not in oncolumns ) ] if ( not oncolumns ) : oncolumns = [ attr for attr in attributes if ( attr not in onrows ) ] return ( onrows , oncolumns )
returns a tuple 9onrows .