

def __init__(self, pattern, handler, kwargs=None, name=None):
    "Parameters:\n\n        * ``pattern``: Regular expression to be matched.  Any groups\n          in the regex will be passed in to the handler's get/post/etc\n          methods as arguments.\n\n        * ``handler``: `RequestHandler` subclass to be invoked.\n\n        * ``kwargs`` (optional): A dictionary of additional arguments\n          to be passed to the handler's constructor.\n\n        * ``name`` (optional): A name for this handler.  Used by\n          `Application.reverse_url`.\n        "
    if (not pattern.endswith('$')):
        pattern += '$'
    self.regex = re.compile(pattern)
    assert (len(self.regex.groupindex) in (0, self.regex.groups)), ('groups in url regexes must either be all named or all positional: %r' % self.regex.pattern)
    if isinstance(handler, str):
        handler = import_object(handler)
    self.handler_class = handler
    self.kwargs = (kwargs or {
        
    })
    self.name = name
    (self._path, self._group_count) = self._find_groups()

dataset/ETHPy150Open RobotWebTools/rosbridge_suite/rosbridge_server/src/tornado/web.py URLSpec.__init__/original