<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_url(url, handler, name=None, kwargs=None):
 """insert url into tornado application handlers group :arg str url: url :handler object handler: url mapping handler :name reverse url name :kwargs dict tornado handler initlize args """

    if name is None and kwargs is None:
        app_config.urls.append((url, handler))
        return

    if name is None:
        app_config.urls.append((url, handler, kwargs))
        return

    app_config.urls.append((url, handler, kwargs, name))