<commit_before>"""Views fo the node settings page."""
# -*- coding: utf-8 -*-
import os
import httplib as http

from flask import request
from box.client import BoxClientException
from urllib3.exceptions import MaxRetryError

from framework.exceptions import HTTPError

from website.util import web_url_for
from website.util import permissions
from website.project.decorators import (
    must_have_addon, must_be_addon_authorizer,
    must_have_permission, must_not_be_registration,
)

from website.addons.box.client import get_node_client
from website.addons.box.client import get_client_from_user_settings

from website.addons.box import settings

BOX_SHARE_URL_TEMPLATE = 'https://app.box.com/files/0/f/{0}'

@must_have_addon('box', 'node')
@must_have_permission(permissions.WRITE)
def box_config_get(node_addon, auth, **kwargs):
    """API that returns the serialized node settings."""
    return {
        'result': serialize_settings(node_addon, auth.user),
    }


def serialize_folder(metadata):
    """Serializes metadata to a dict with the display name and path
    of the folder.
    """
    # if path is root
    if metadata['path'] == '' or metadata['path'] == '/':
        name = 'All Files'
    else:
        name = 'Box' + metadata['path']<commit_msg>fix the travis build<commit_after>"""Views fo the node settings page."""
# -*- coding: utf-8 -*-
import os
import httplib as http

from flask import request
from box.client import BoxClientException
from urllib3.exceptions import MaxRetryError

from framework.exceptions import HTTPError

from website.util import web_url_for
from website.util import permissions
from website.project.decorators import (
    must_have_addon, must_be_addon_authorizer,
    must_have_permission, must_not_be_registration,
)

from website.addons.box.client import get_node_client
from website.addons.box.client import get_client_from_user_settings


BOX_SHARE_URL_TEMPLATE = 'https://app.box.com/files/0/f/{0}'

@must_have_addon('box', 'node')
@must_have_permission(permissions.WRITE)
def box_config_get(node_addon, auth, **kwargs):
    """API that returns the serialized node settings."""
    return {
        'result': serialize_settings(node_addon, auth.user),
    }


def serialize_folder(metadata):
    """Serializes metadata to a dict with the display name and path
    of the folder.
    """
    # if path is root
    if metadata['path'] == '' or metadata['path'] == '/':
        name = 'All Files'
    else:
        name = 'Box' + metadata['path']
{'fraction_non_alphanumeric': 0.1038753495805034, 'fraction_numerical': 0.0031961646024770275, 'mean_word_length': 4.35042735042735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2118575', 'n_tokens_mistral': 765, 'n_tokens_neox': 765, 'n_words': 214}