  from rest_framework.schemas.views import SchemaView
  from rest_framework.settings import api_settings
  from rest_framework.urlpatterns import format_suffix_patterns
  
  Route = namedtuple('Route', ['url', 'mapping', 'name', 'initkwargs'])
  DynamicDetailRoute = namedtuple('DynamicDetailRoute', ['url', 'name', 'initkwargs'])
  DynamicListRoute = namedtuple('DynamicListRoute', ['url', 'name', 'initkwargs'])
  
  
  def escape_curly_brackets(url_path):
      """
      Double brackets in regex of url_path for escape string formatting
 
</s> remove from rest_framework.decorators import detail_route, list_route
 </s> add from rest_framework.decorators import action </s> remove from rest_framework.decorators import detail_route, list_route
 </s> add from rest_framework.decorators import action
Route = namedtuple('Route', ['url', 'mapping', 'name', 'detail', 'initkwargs'])
DynamicRoute = namedtuple('DynamicRoute', ['url', 'name', 'detail', 'initkwargs'])


class DynamicDetailRoute(object):
    def __new__(cls, url, name, initkwargs):
        warnings.warn(
            "`DynamicDetailRoute` is pending deprecation and will be removed in 3.10 "
            "in favor of `DynamicRoute`, which accepts a `detail` boolean. Use "
            "`DynamicRoute(url, name, True, initkwargs)` instead.",
            PendingDeprecationWarning, stacklevel=2
        )
        return DynamicRoute(url, name, True, initkwargs)


class DynamicListRoute(object):
    def __new__(cls, url, name, initkwargs):
        warnings.warn(
            "`DynamicListRoute` is pending deprecation and will be removed in 3.10 in "
            "favor of `DynamicRoute`, which accepts a `detail` boolean. Use "
            "`DynamicRoute(url, name, False, initkwargs)` instead.",
            PendingDeprecationWarning, stacklevel=2
        )
        return DynamicRoute(url, name, False, initkwargs)
  from rest_framework.schemas.views import SchemaView
  from rest_framework.settings import api_settings
  from rest_framework.urlpatterns import format_suffix_patterns
  
Route = namedtuple('Route', ['url', 'mapping', 'name', 'detail', 'initkwargs'])
DynamicRoute = namedtuple('DynamicRoute', ['url', 'name', 'detail', 'initkwargs'])


class DynamicDetailRoute(object):
    def __new__(cls, url, name, initkwargs):
        warnings.warn(
            "`DynamicDetailRoute` is pending deprecation and will be removed in 3.10 "
            "in favor of `DynamicRoute`, which accepts a `detail` boolean. Use "
            "`DynamicRoute(url, name, True, initkwargs)` instead.",
            PendingDeprecationWarning, stacklevel=2
        )
        return DynamicRoute(url, name, True, initkwargs)


class DynamicListRoute(object):
    def __new__(cls, url, name, initkwargs):
        warnings.warn(
            "`DynamicListRoute` is pending deprecation and will be removed in 3.10 in "
            "favor of `DynamicRoute`, which accepts a `detail` boolean. Use "
            "`DynamicRoute(url, name, False, initkwargs)` instead.",
            PendingDeprecationWarning, stacklevel=2
        )
        return DynamicRoute(url, name, False, initkwargs)
Route = namedtuple('Route', ['url', 'mapping', 'name', 'detail', 'initkwargs'])
DynamicRoute = namedtuple('DynamicRoute', ['url', 'name', 'detail', 'initkwargs'])


class DynamicDetailRoute(object):
    def __new__(cls, url, name, initkwargs):
        warnings.warn(
            "`DynamicDetailRoute` is pending deprecation and will be removed in 3.10 "
            "in favor of `DynamicRoute`, which accepts a `detail` boolean. Use "
            "`DynamicRoute(url, name, True, initkwargs)` instead.",
            PendingDeprecationWarning, stacklevel=2
        )
        return DynamicRoute(url, name, True, initkwargs)


class DynamicListRoute(object):
    def __new__(cls, url, name, initkwargs):
        warnings.warn(
            "`DynamicListRoute` is pending deprecation and will be removed in 3.10 in "
            "favor of `DynamicRoute`, which accepts a `detail` boolean. Use "
            "`DynamicRoute(url, name, False, initkwargs)` instead.",
            PendingDeprecationWarning, stacklevel=2
        )
        return DynamicRoute(url, name, False, initkwargs)
Route = namedtuple('Route', ['url', 'mapping', 'name', 'detail', 'initkwargs'])
DynamicRoute = namedtuple('DynamicRoute', ['url', 'name', 'detail', 'initkwargs'])


class DynamicDetailRoute(object):
    def __new__(cls, url, name, initkwargs):
        warnings.warn(
            "`DynamicDetailRoute` is pending deprecation and will be removed in 3.10 "
            "in favor of `DynamicRoute`, which accepts a `detail` boolean. Use "
            "`DynamicRoute(url, name, True, initkwargs)` instead.",
            PendingDeprecationWarning, stacklevel=2
        )
        return DynamicRoute(url, name, True, initkwargs)


class DynamicListRoute(object):
    def __new__(cls, url, name, initkwargs):
        warnings.warn(
            "`DynamicListRoute` is pending deprecation and will be removed in 3.10 in "
            "favor of `DynamicRoute`, which accepts a `detail` boolean. Use "
            "`DynamicRoute(url, name, False, initkwargs)` instead.",
            PendingDeprecationWarning, stacklevel=2
        )
        return DynamicRoute(url, name, False, initkwargs)
  
  
  def escape_curly_brackets(url_path):
      """
      Double brackets in regex of url_path for escape string formatting
keep keep keep keep replace replace replace keep keep keep keep keep
 Rework dynamic list/detail actions (#5705)

* Merge list/detail route decorators into 'action'

* Merge dynamic routes, add 'detail' attribute

* Add 'ViewSet.get_extra_actions()'

* Refactor dynamic route checking & collection

* Refactor dynamic route generation

* Add 'ViewSet.detail' initkwarg

* Fixup schema test

* Add release notes for dynamic action changes

* Replace list/detail route decorators in tests

* Convert tabs to spaces in router docs

* Update docs

* Make 'detail' a required argument of 'action'

* Improve router docs 
rest_framework/routers.py