<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_extension(cls, ext):
 """checks that path's extension against the Writer's supported extensions. If it isn't supported, raises UnsupportedFiletypeError."""

        if ext.startswith('.'):
            ext = ext[1:]
        if not any(ext in extension for extension in cls.supported_extensions):
            msg = ("Invalid extension for engine '{engine}': '{ext}'"
                   .format(engine=pprint_thing(cls.engine),
                           ext=pprint_thing(ext)))
            raise ValueError(msg)
        else:
            return True