def get_samples():
samples = {}<EOL>module_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "<STR_LIT>")<EOL>for file in sorted(os.listdir(module_dir)):<EOL><INDENT>if file.endswith("<STR_LIT>") and file != "<STR_LIT>":<EOL><INDENT>module_name = file[:-<NUM_LIT:3>]<EOL>with open(os.path.join(module_dir, file), "<STR_LIT:r>") as f:<EOL><INDENT>try:<EOL><INDENT>module = ast.parse(f.read())<EOL><DEDENT>except SyntaxError:<EOL><INDENT>continue<EOL><DEDENT>raw_docstring = ast.get_docstring(module)<EOL>if raw_docstring is None:<EOL><INDENT>continue<EOL><DEDENT>parts = re.split("<STR_LIT>", raw_docstring, flags=re.M)<EOL>if len(parts) == <NUM_LIT:1>:<EOL><INDENT>continue<EOL><DEDENT>sample_data = parts[<NUM_LIT:1>]<EOL>samples.update(parse_sample_data(sample_data, module_name))<EOL><DEDENT><DEDENT><DEDENT>return samples<EOL>
Look in all core modules and get any samples from the docstrings.
return a dict {screenshot_name: sample_output}