def _read_sam_file(template):
if not os.path.exists(template):<EOL><INDENT>click.secho("<STR_LIT>", bg='<STR_LIT>')<EOL>raise SamTemplateNotFoundException("<STR_LIT>".format(template))<EOL><DEDENT>with click.open_file(template, '<STR_LIT:r>') as sam_template:<EOL><INDENT>sam_template = yaml_parse(sam_template.read())<EOL><DEDENT>return sam_template<EOL>
Reads the file (json and yaml supported) provided and returns the dictionary representation of the file.

:param str template: Path to the template file
:return dict: Dictionary representing the SAM Template
:raises: SamTemplateNotFoundException when the template file does not exist