@environmentfilter
def do_random(environment, seq):
 try:
  return choice(seq)
 except IndexError:
  return environment.undefined('No random item, sequence was empty.')

@ environmentfilter def do_random ( environment , seq ) : try : return choice ( seq ) except IndexError : return environment . undefined ( 'No random item, sequence was empty.' )
return a random item from the sequence .