def parse_sample_data(sample_data, module_name):
samples = {}<EOL>for index, chunk in enumerate(sample_data.split("<STR_LIT>")):<EOL><INDENT>chunk = "<STR_LIT>".format(module_name, index, chunk)<EOL>name, sample = re.split("<STR_LIT>", chunk, <NUM_LIT:1>)<EOL>try:<EOL><INDENT>samples[name] = ast.literal_eval(sample)<EOL><DEDENT>except SyntaxError:<EOL><INDENT>samples[name] = SAMPLE_DATA_ERROR<EOL><DEDENT><DEDENT>return samples<EOL>
Parse sample output definitions and return a dict
{screenshot_name: sample_output}