<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reader_from_path(cls, path):
 """Create a model from specified path. Path can be a directory containing a ``model.yaml`` or ``model.yml`` file or it can be a path naming the central model file directly. """

        context = FilePathContext(path)
        try:
            with open(context.filepath, 'r') as f:
                return ModelReader(f, context)
        except IOError:
            # Try to open the default file
            for filename in cls.DEFAULT_MODEL:
                try:
                    context = FilePathContext(
                        os.path.join(path, filename))
                    with open(context.filepath, 'r') as f:
                        return ModelReader(f, context)
                except:
                    logger.debug('Failed to load model file',
                                 exc_info=True)

        # No model could be loaded
        raise ParseError('No model file could be found ({})'.format(
            ', '.join(cls.DEFAULT_MODEL)))