<commit_before># Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import six

from dashboard import update_test_suite_descriptors
from dashboard.api import api_request_handler

from flask import make_response, request


def _CheckUser():
  pass


@api_request_handler.RequestHandlerDecoratorFactory(_CheckUser)
def DescribePost():
  master = request.values.get('master')
  suite = request.values.get('test_suite')
  return make_response(
      update_test_suite_descriptors.FetchCachedTestSuiteDescriptor(
          master, suite))


if six.PY2:
  # pylint: disable=abstract-method
  class DescribeHandler(api_request_handler.ApiRequestHandler):
    """API handler for describing test suites."""

    def _CheckUser(self):
      pass

    def Post(self, *args, **kwargs):
      del args, kwargs  # Unused.<commit_msg>fix /api/describe, make_response was called twice<commit_after># Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

import six

from dashboard import update_test_suite_descriptors
from dashboard.api import api_request_handler

from flask import request


def _CheckUser():
  pass


@api_request_handler.RequestHandlerDecoratorFactory(_CheckUser)
def DescribePost():
  master = request.values.get('master')
  suite = request.values.get('test_suite')
  return update_test_suite_descriptors.FetchCachedTestSuiteDescriptor(
          master, suite)


if six.PY2:
  # pylint: disable=abstract-method
  class DescribeHandler(api_request_handler.ApiRequestHandler):
    """API handler for describing test suites."""

    def _CheckUser(self):
      pass

    def Post(self, *args, **kwargs):
      del args, kwargs  # Unused.
{'fraction_non_alphanumeric': 0.07029369282619162, 'fraction_numerical': 0.004814636494944632, 'mean_word_length': 4.804469273743017, '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': '4607571', 'n_tokens_mistral': 596, 'n_tokens_neox': 574, 'n_words': 188}