<commit_before>from rest_framework.routers import Route, DynamicDetailRoute, SimpleRouter

class ReadOnlyRouter(SimpleRouter):
    """
    A router for read-only APIs, only supports retrieving the list (ex. '/users' or a single user ex. '/user/id')
    """
    # test
    routes = [
        Route(
            url=r'^{prefix}s$',
            mapping={'get': 'list'},
            name='{basename}-list',
            initkwargs={'suffix': 'List'}
        ),
        Route(
            url=r'^{prefix}/{lookup}$',
           mapping={'get': 'retrieve'},
           name='{basename}-detail',
           initkwargs={'suffix': 'Detail'}
        ),
        DynamicDetailRoute(
            url=r'^{prefix}/{lookup}/{methodnamehyphen}$',
            name='{basename}-{methodnamehyphen}',
            initkwargs={}
        )
    ]<commit_msg>CustomSimpleRouter<commit_after>from rest_framework.routers import Route, DynamicDetailRoute, SimpleRouter

class CustomSimpleRouter(SimpleRouter):
    """
    A router for read-only APIs, only supports retrieving the list (ex. '/users' or a single user ex. '/user/id')
    """
    routes = [
        Route(
            url=r'^{prefix}s$',
            mapping={'get': 'list'},
            name='{basename}-list',
            initkwargs={'suffix': 'List'}
        ),
        Route(
            url=r'^{prefix}/{lookup}$',
           mapping={'get': 'retrieve',
                    'put' : 'update'},
           name='{basename}-detail',
           initkwargs={'suffix': 'Detail'}
        ),
        DynamicDetailRoute(
            url=r'^{prefix}/{lookup}/{methodnamehyphen}$',
            name='{basename}-{methodnamehyphen}',
            initkwargs={}
        )
    ]
{'fraction_non_alphanumeric': 0.15941176470588236, 'fraction_numerical': 0.0, 'mean_word_length': 2.0593525179856114, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7647820', 'n_tokens_mistral': 485, 'n_tokens_neox': 478, 'n_words': 93}