#NEWLINE# def split_on_comma( tokens ) : #NEWLINE# #INDENT# 'Split a list of tokens on commas, ie ``,`` DELIM tokens.\n\n    Only "top-level" comma tokens are splitting points, not commas inside a\n    function or other :class:`ContainerToken`.\n\n    :param tokens:\n        An iterable of :class:`~.token_data.Token` or\n        :class:`~.token_data.ContainerToken`.\n    :returns:\n        A list of lists of tokens\n\n    ' #NEWLINE# parts = [ ] #NEWLINE# this_part = [ ] #NEWLINE# for token in parts : #NEWLINE# #INDENT# if ( ( token . type == 'DELIM' ) and ( token . value == ',' ) ) : #NEWLINE# #INDENT# parts . append ( this_part ) #NEWLINE# this_part = [ ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# this_part . append ( token ) #NEWLINE# #UNINDENT# #UNINDENT# parts . append ( this_part ) #NEWLINE# return parts