<commit_before># Copyright (c) 2010 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#

import simplejson as json
from datetime import datetime, timedelta
from urllib2 import HTTPError

from django.db import transaction
from django.http import HttpResponse, HttpResponseForbidden
from django.shortcuts import get_object_or_404

from .cell import undefined
from .models import Sheet
from .utils.cell_name_utils import cell_ref_as_string_to_coordinates
from .views import rollback_on_exception
from user.models import OneTimePad


@transaction.commit_manually
@rollback_on_exception
def calculate_and_get_json_for_api(request, username, sheet_id):
    sheet = get_object_or_404(Sheet, pk=sheet_id, owner__username=username)
    pads = None

    if request.method == 'POST':<commit_msg>remove old commit manually decorator<commit_after># Copyright (c) 2010 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#

import simplejson as json
from datetime import datetime, timedelta
from urllib2 import HTTPError

from django.db import transaction
from django.http import HttpResponse, HttpResponseForbidden
from django.shortcuts import get_object_or_404

from .cell import undefined
from .models import Sheet
from .utils.cell_name_utils import cell_ref_as_string_to_coordinates
from .views import rollback_on_exception
from user.models import OneTimePad


@rollback_on_exception
def calculate_and_get_json_for_api(request, username, sheet_id):
    sheet = get_object_or_404(Sheet, pk=sheet_id, owner__username=username)
    pads = None

    if request.method == 'POST':
{'fraction_non_alphanumeric': 0.053231939163498096, 'fraction_numerical': 0.01394169835234474, 'mean_word_length': 6.344186046511628, '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': '6946301', 'n_tokens_mistral': 482, 'n_tokens_neox': 459, 'n_words': 146}