<commit_before># -*- coding: utf-8 -*-

from framework.routing import Rule, json_renderer

from website.addons.github import views

settings_routes = {
    'rules': [

        # Configuration
        Rule(
            [
                '/project/<pid>/github/settings/',
                '/project/<pid>/node/<nid>/github/settings/',
            ],
            'post',
            views.config.github_set_config,
            json_renderer,
        ),

        Rule(
            [
                '/project/<pid>/github/tarball/',
                '/project/<pid>/node/<nid>/github/tarball/',
            ],
            'get',
            views.crud.github_download_starball,
            json_renderer,
            {'archive': 'tar'},
            endpoint_suffix='__tar',
        ),
        Rule(
            [
                '/project/<pid>/github/zipball/',
                '/project/<pid>/node/<nid>/github/zipball/',
            ],
            'get',
            views.crud.github_download_starball,
            json_renderer,
            {'archive': 'zip'},
            endpoint_suffix='__zip',
        ),

        Rule(
            [
                '/project/<pid>/github/hook/',
                '/project/<pid>/node/<nid>/github/hook/',
            ],
            'post',
            views.hooks.github_hook_callback,
            json_renderer,
        ),

        # OAuth: User
        Rule(
            '/settings/github/oauth/',
            'get',
            views.auth.github_oauth_start,
            json_renderer,
            endpoint_suffix='__user',
        ),
        Rule(
            '/settings/github/oauth/',
            'delete',
            views.auth.github_oauth_delete_user,
            json_renderer,
        ),

        # OAuth: Node
        Rule(
            [
                '/project/<pid>/github/oauth/',
                '/project/<pid>/node/<nid>/github/oauth/',
            ],
            'get',
            views.auth.github_oauth_start,
            json_renderer,
        ),
        Rule(
            [
                '/project/<pid>/github/user_auth/',
                '/project/<pid>/node/<nid>/github/user_auth/',
            ],
            'post',
            views.auth.github_add_user_auth,
            json_renderer,
        ),
        Rule(
            [
                '/project/<pid>/github/oauth/',
                '/project/<pid>/node/<nid>/github/oauth/',
                '/project/<pid>/github/config/',
                '/project/<pid>/node/<nid>/github/config/'

            ],
            'delete',
            views.auth.github_oauth_deauthorize_node,
            json_renderer,
        ),

        # OAuth: General
        Rule(
            [
                '/addons/github/callback/<uid>/',
                '/addons/github/callback/<uid>/<nid>/',
            ],
            'get',
            views.auth.github_oauth_callback,
            json_renderer,
        ),
    ],
    'prefix': '/api/v1',
}

api_routes = {
    'rules': [

        Rule(
            '/github/repo/create/',
            'post',
            views.repos.github_create_repo,
            json_renderer,
        ),

        Rule(
            [
                '/project/<pid>/github/hgrid/root/',
                '/project/<pid>/node/<nid>/github/hgrid/root/',
            ],
            'get',
            views.hgrid.github_root_folder_public,
            json_renderer,
        ),

    ],
    'prefix': '/api/v1'
}<commit_msg>Update routes     -TODO: finish routes<commit_after># -*- coding: utf-8 -*-

from framework.routing import Rule, json_renderer

from website.addons.github import views

settings_routes = {
    'rules': [

        # Configuration
        Rule(
            [
                '/project/<pid>/github/settings/',
                '/project/<pid>/node/<nid>/github/settings/',
            ],
            'post',
            views.github_set_config,
            json_renderer,
        ),

        Rule(
            [
                '/project/<pid>/github/tarball/',
                '/project/<pid>/node/<nid>/github/tarball/',
            ],
            'get',
            views.github_download_starball,
            json_renderer,
            {'archive': 'tar'},
            endpoint_suffix='__tar',
        ),
        Rule(
            [
                '/project/<pid>/github/zipball/',
                '/project/<pid>/node/<nid>/github/zipball/',
            ],
            'get',
            views.github_download_starball,
            json_renderer,
            {'archive': 'zip'},
            endpoint_suffix='__zip',
        ),

        Rule(
            [
                '/project/<pid>/github/hook/',
                '/project/<pid>/node/<nid>/github/hook/',
            ],
            'post',
            views.github_hook_callback,
            json_renderer,
        ),
    ],
    'prefix': '/api/v1',
}

api_routes = {
    'rules': [

        Rule(
            '/github/repo/create/',
            'post',
            views.github_create_repo,
            json_renderer,
        ),

        Rule(
            [
                '/project/<pid>/github/hgrid/root/',
                '/project/<pid>/node/<nid>/github/hgrid/root/',
            ],
            'get',
            views.github_root_folder,
            json_renderer,
        ),

    ],
    'prefix': '/api/v1'
}
{'fraction_non_alphanumeric': 0.1436609152288072, 'fraction_numerical': 0.0011252813203300824, 'mean_word_length': 1.1137534680935395, 'pattern_counts': {'":': 0, '<': 48, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3605780', 'n_tokens_mistral': 1544, 'n_tokens_neox': 1519, 'n_words': 171}