<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def strict(*types):
 """Decorator, type check production rule output"""


    def decorate(func):
        @wraps(func)
        def wrapper(self, p):
            func(self, p)
            if not isinstance(p[0], types):
                raise YAMLStrictTypeError(p[0], types, func)

        wrapper.co_firstlineno = func.__code__.co_firstlineno
        return wrapper

    return decorate