def _get_tuple_from_route(route):
if isinstance(route, tuple):<EOL><INDENT>assert len(route) >= <NUM_LIT:2><EOL>pattern, handler_class = route[:<NUM_LIT:2>]<EOL><DEDENT>elif isinstance(route, tornado.web.URLSpec):<EOL><INDENT>pattern, handler_class = route.regex.pattern, route.handler_class<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>.format(type(route).__name__))<EOL><DEDENT>methods = []<EOL>route_re = re.compile(pattern)<EOL>route_params = set(list(route_re.groupindex.keys()) + ['<STR_LIT>'])<EOL>for http_method in HTTP_METHODS:<EOL><INDENT>method = getattr(handler_class, http_method, None)<EOL>if method:<EOL><INDENT>method = extract_method(method)<EOL>method_params = set(getattr(method, "<STR_LIT>",<EOL>inspect.getargspec(method).args))<EOL>if route_params.issubset(method_params) andmethod_params.issubset(route_params):<EOL><INDENT>methods.append(http_method)<EOL><DEDENT><DEDENT><DEDENT>return pattern, handler_class, methods<EOL>
Return (pattern, handler_class, methods) tuple from ``route``

    :type route: tuple|tornado.web.URLSpec
    :rtype: tuple
    :raises TypeError: If ``route`` is not a tuple or URLSpec