def parse_model_file(path):
context = FilePathContext(path)<EOL>format = resolve_format(None, context.filepath)<EOL>if format == '<STR_LIT>':<EOL><INDENT>logger.debug('<STR_LIT>'.format(context.filepath))<EOL>with context.open('<STR_LIT:r>') as f:<EOL><INDENT>for reaction_id in parse_model_table_file(context, f):<EOL><INDENT>yield reaction_id<EOL><DEDENT><DEDENT><DEDENT>elif format == '<STR_LIT>':<EOL><INDENT>logger.debug('<STR_LIT>'.format(context.filepath))<EOL>with context.open('<STR_LIT:r>') as f:<EOL><INDENT>for reaction_id in parse_model_yaml_file(context, f):<EOL><INDENT>yield reaction_id<EOL><DEDENT><DEDENT><DEDENT>
Parse a file as a list of model reactions

    The file format is detected and the file is parsed accordinly. The file is
    specified as a file path that will be opened for reading. Path can be given
    as a string or a context.