def validate_response(expected_responses):
def internal_decorator(function):<EOL><INDENT>@wraps(function)<EOL>async def wrapper(*args, **kwargs):<EOL><INDENT>response = await function(*args, **kwargs)<EOL>for expected_response in expected_responses:<EOL><INDENT>if response.startswith(expected_response):<EOL><INDENT>return response<EOL><DEDENT><DEDENT>raise QRTCommandException(<EOL>"<STR_LIT>" % (expected_responses, response)<EOL>)<EOL><DEDENT>return wrapper<EOL><DEDENT>return internal_decorator<EOL>
Decorator to validate responses from QTM