def parse_alpha(args):
 if ((len(args) == 1) and (args[0].type in (u'NUMBER', u'INTEGER'))):
  return min(1, max(0, args[0].value))

def parse_alpha ( args ) : if ( ( len ( args ) == 1 ) and ( args [ 0 ] . type in ( u'NUMBER' , u'INTEGER' ) ) ) : return min ( 1 , max ( 0 , args [ 0 ] . value ) )
if args is a list of a single integer or number token .