def vote_display(vote, arg=None):
 if (arg is None):
  arg = 'Up,Down'
 bits = arg.split(',')
 if (len(bits) != 2):
  return vote.vote
 (up, down) = bits
 if (vote.vote == 1):
  return up
 return down

def vote_display ( vote , arg = None ) : if ( arg is None ) : arg = 'Up,Down' bits = arg . split ( ',' ) if ( len ( bits ) != 2 ) : return vote . vote ( up , down ) = bits if ( vote . vote == 1 ) : return up return down
given a string mapping values for up and down votes .