def hyphen_range(string):
list_numbers = list()<EOL>temporary_list = string.split("<STR_LIT:U+002C>")<EOL>for element in temporary_list:<EOL><INDENT>sub_element = element.split("<STR_LIT:->")<EOL>if len(sub_element) == <NUM_LIT:1>:<EOL><INDENT>list_numbers.append(int(sub_element[<NUM_LIT:0>]))<EOL><DEDENT>elif len(sub_element) == <NUM_LIT:2>:<EOL><INDENT>for number in range(int(sub_element[<NUM_LIT:0>]), int(sub_element[<NUM_LIT:1>]) + <NUM_LIT:1>):<EOL><INDENT>list_numbers.append(number)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise Exception(<EOL>"<STR_LIT>".format(string)<EOL>)<EOL><DEDENT><DEDENT>return list_numbers<EOL>
Expands a string of numbers separated by commas and hyphens into a list of integers.
For example:  2-3,5-7,20-21,23,100-200