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

from flask import (
    make_response,
    request,
    Response
    )

from . import apiclient
from . import peerdatastorage
from .perfume import Perfume, route
from yamlns import namespace as ns

"""
# TODO:

Roadmap:

- [ ] route activateservice/<peer>/<service>
    - [ ] fields = portal.requiredFields(peer, service)
        - [ ] when service fields, use them
        - [ ] when no service fields, use global peer fields
    - [ ] data = portal.userInfo(userid, fields)
        - [ ] works
        - [ ] no such user
        - [ ] no such field
    - [ ] translations = portal.fieldTranslation(fields)
    - [ ] fieldhtml = portal.renderField(fieldLabel, value)
    - [ ] innerhtml = portal.renderUserData(data)

Postponed:

- [ ] Solve translations
- [ ] Should different types in field be rendered differently
- [ ] No service description
- [ ] No service name
- [ ] No such service
- [ ] Include peer.info optionally
- [ ] require login
"""



template = u"""\
<html>
<head>
<meta encoding='utf-8' /><commit_msg>commits<commit_after># -*- encoding: utf-8 -*-

from flask import (
    make_response,
    request,
    Response
    )

from . import apiclient
from . import peerdatastorage
from .perfume import Perfume, route
from yamlns import namespace as ns

"""
# TODO:

Roadmap:

- [ ] route activateservice/<peer>/<service>
    - [ ] fields = portal.requiredFields(peer, service)
        - [ ] when service fields, use them
        - [ ] when no service fields, use global peer fields
    - [+] data = portal.userInfo(userid, fields)
        - [+] all fields
        - [+] filtering
        - [+] no such user
        - [+] no such field
    - [ ] translations = portal.fieldTranslation(fields)
    - [ ] fieldhtml = portal.renderField(fieldLabel, value)
    - [ ] innerhtml = portal.renderUserData(data)

Postponed:

- [ ] Solve translations
- [ ] Should different types in field be rendered differently
- [ ] No service description
- [ ] No service name
- [ ] No such service
- [ ] Include peer.info optionally
- [ ] require login
"""



template = u"""\
<html>
<head>
<meta encoding='utf-8' />
{'fraction_non_alphanumeric': 0.1265704979060028, 'fraction_numerical': 0.0018613308515588647, 'mean_word_length': 2.6941580756013748, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2343305', 'n_tokens_mistral': 669, 'n_tokens_neox': 646, 'n_words': 190}