  from rest_framework.reverse import reverse
  from rest_framework.urlpatterns import format_suffix_patterns
  
  
  Route = namedtuple('Route', ['key', 'url', 'mapping', 'name', 'initkwargs'])
  
  
  def replace_methodname(format_string, methodname):
      """
      Partially format a format_string, swapping out any
 
</s> remove         known_actions = flatten([route.mapping.values() for route in self.routes])
 </s> add         known_actions = flatten([route.mapping.values() for route in self.routes if isinstance(route, Route)]) </s> remove             if route.key == 'dynamic':
 </s> add             if isinstance(route, DynamicDetailRoute): </s> remove             key='list',
 </s> add  </s> remove                         key=route.key,
 </s> add  </s> remove                         key=route.key,
 </s> add 
Route = namedtuple('Route', ['url', 'mapping', 'name', 'initkwargs'])
DynamicDetailRoute = namedtuple('DynamicDetailRoute', ['url', 'name', 'initkwargs'])
DynamicListRoute = namedtuple('DynamicListRoute', ['url', 'name', 'initkwargs'])
  from rest_framework.reverse import reverse
  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 replace_methodname(format_string, methodname):
      """
      Partially format a format_string, swapping out any
keep keep keep keep replace keep keep keep keep keep
 Introduce DynamicDetailRoute and DynamicListRoute to distinguish between different route types 
rest_framework/routers.py