<commit_before># coding: utf-8

import urllib

from flask.ext import wtf
from google.appengine.api import images
from google.appengine.ext import blobstore
import flask
import werkzeug

import auth
import config
import model
import util

from main import app


################################################################################
# Upload
################################################################################
@app.route('/_s/resource/upload/', endpoint='resource_upload_service', methods=['GET', 'POST'])
@app.route('/resource/upload/', endpoint='resource_upload', methods=['GET', 'POST'])
@auth.login_required
def resource_upload():
  if flask.request.method == 'GET':
    gs_bucket_name = config.CONFIG_DB.bucket_name or None
    count = util.param('count', int) or 1

    if flask.request.path.startswith('/_s/'):
      urls = []
      for _ in range(count):
        urls.append({'upload_url': blobstore.create_upload_url(
            flask.request.path,
            gs_bucket_name=gs_bucket_name,
          )})
      return flask.jsonify({
          'status': 'success',<commit_msg>Avoid name clash (in derived projects)<commit_after># coding: utf-8

import urllib

from flask.ext import wtf
from google.appengine.api import images
from google.appengine.ext import blobstore
import flask
import werkzeug

import auth
import config
import model
import util

from main import app


################################################################################
# Upload
################################################################################
@app.route('/_s/resource/upload/', endpoint='resource_upload_service', methods=['GET', 'POST'])
@app.route('/resource/upload/', endpoint='resource_upload', methods=['GET', 'POST'])
@auth.login_required
def resource_upload():
  if flask.request.method == 'GET':
    gs_bucket_name = config.CONFIG_DB.bucket_name or None
    count = util.param('count', int) or 1

    if flask.request.path.startswith('/_s/'):
      urls = []
      for i in range(count):
        urls.append({'upload_url': blobstore.create_upload_url(
            flask.request.path,
            gs_bucket_name=gs_bucket_name,
          )})
      return flask.jsonify({
          'status': 'success',
{'fraction_non_alphanumeric': 0.25055728934462773, 'fraction_numerical': 0.0017833259028087382, 'mean_word_length': 4.4731707317073175, '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': '1019133', 'n_tokens_mistral': 636, 'n_tokens_neox': 607, 'n_words': 147}