<commit_before>(function () {
    'use strict';

    define(
        [
            'page',
            'querystring',
            'util/bind'
        ],
        function (page, qs, bind) {
            var routes, types = [ 'library', 'photographs', 'museum', 'memorials' ];

            routes = function () {
                page('/', function (context) {
                    return bind('ui/pages/static/home', 'ui/pages/static/StaticPage', context);
                });

                page('/about', function (context) {
                    return bind('ui/pages/static/about', 'ui/pages/static/StaticPage', context);
                });

                page('/:type/search', function (context) {
                    if (types.indexOf(context.params.type) < 0) {
                        return bind('ui/pages/error/404', 'ui/pages/error/ErrorPage', context);
                    }
                    return bind('ui/pages/search/index', 'ui/pages/search/SearchPage', context);
                });

                page('/:type/detail/:id', function (context) {
                    if (types.indexOf(context.params.type) < 0) {
                        return bind('ui/pages/error/404', 'ui/pages/error/ErrorPage', context);
                    }
                    return bind('ui/pages/detail/index', 'ui/pages/detail/DetailPage', context);
                });

                page('*', function (context) {
                    return bind('ui/pages/error/404', 'ui/pages/error/ErrorPage', context);
                });

                page();
            };

            routes.searchUrlFor = function (type, query) {
                return '/' + type + '/search' + (query ? '?' + qs.stringify(query) : '');
            };

            routes.detailUrlFor = function (type, id) {
                return '/' + type + '/detail/' + id;
            };

            routes.pushState = function (url) {
                return page(url);
            };<commit_msg>Revert to `window.history.pushState` instead of `page`.<commit_after>(function () {
    'use strict';

    define(
        [
            'page',
            'querystring',
            'util/bind'
        ],
        function (page, qs, bind) {
            var routes, types = [ 'library', 'photographs', 'museum', 'memorials' ];

            routes = function () {
                page('/', function (context) {
                    return bind('ui/pages/static/home', 'ui/pages/static/StaticPage', context);
                });

                page('/about', function (context) {
                    return bind('ui/pages/static/about', 'ui/pages/static/StaticPage', context);
                });

                page('/:type/search', function (context) {
                    if (types.indexOf(context.params.type) < 0) {
                        return bind('ui/pages/error/404', 'ui/pages/error/ErrorPage', context);
                    }
                    return bind('ui/pages/search/index', 'ui/pages/search/SearchPage', context);
                });

                page('/:type/detail/:id', function (context) {
                    if (types.indexOf(context.params.type) < 0) {
                        return bind('ui/pages/error/404', 'ui/pages/error/ErrorPage', context);
                    }
                    return bind('ui/pages/detail/index', 'ui/pages/detail/DetailPage', context);
                });

                page('*', function (context) {
                    return bind('ui/pages/error/404', 'ui/pages/error/ErrorPage', context);
                });

                page();
            };

            routes.searchUrlFor = function (type, query) {
                return '/' + type + '/search' + (query ? '?' + qs.stringify(query) : '');
            };

            routes.detailUrlFor = function (type, id) {
                return '/' + type + '/detail/' + id;
            };

            routes.pushState = function (url) {
                return window.history.pushState({}, window.title, url);
            };
{'fraction_non_alphanumeric': 0.15239043824701196, 'fraction_numerical': 0.005478087649402391, 'mean_word_length': 1.3601645123384254, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5154404', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1016, 'n_words': 191}