def parse_comma_separated(tokens):
 tokens = [token for token in tokens if (token.type != u'S')]
 if (not tokens):
  return []
 if (((len(tokens) % 2) == 1) and all((((token.type == u'DELIM') and (token.value == u',')) for token in tokens[1::2]))):
  return tokens[::2]

def parse_comma_separated ( tokens ) : tokens = [ token for token in tokens if ( token . type != u'S' ) ] if ( not tokens ) : return [ ] if ( ( ( len ( tokens ) % 2 ) == 1 ) and all ( ( ( ( token . type == u'DELIM' ) and ( token . value == u',' ) ) for token in tokens [ 1 : : 2 ] ) ) ) : return tokens [ : : 2 ]
parse a list of tokens as arguments made of a single token each .