<commit_before>#!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
"""Serve data imported in MongoDB."""

import collections
import datetime
import os
import pickle
import sys

import flask
import gflags
import gunicorn.app.base
import pymongo

import add_pythonpath
import display_util
import records_util
from modules.data.proto.record_pb2 import Record
from mongo_util import Mongo


gflags.DEFINE_string('host', '0.0.0.0', 'Web host IP.')
gflags.DEFINE_integer('port', 8887, 'Web host port.')
gflags.DEFINE_integer('workers', 1, 'Web host workers.')
gflags.DEFINE_boolean('debug', True, 'Enable debug mode.')
gflags.DEFINE_integer('page_size', 20, 'Search results per page.')

gflags.DEFINE_string('mongo_collection_name', 'records',
                     'MongoDB collection name.')

app = flask.Flask(__name__)
app.secret_key = str(datetime.datetime.now())
app.jinja_env.filters.update(display_util.utils)

<commit_msg>Data: Disable debug mode in warehouse.<commit_after>#!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
"""Serve data imported in MongoDB."""

import collections
import datetime
import os
import pickle
import sys

import flask
import gflags
import gunicorn.app.base
import pymongo

import add_pythonpath
import display_util
import records_util
from modules.data.proto.record_pb2 import Record
from mongo_util import Mongo


gflags.DEFINE_string('host', '0.0.0.0', 'Web host IP.')
gflags.DEFINE_integer('port', 8887, 'Web host port.')
gflags.DEFINE_integer('workers', 5, 'Web host workers.')
gflags.DEFINE_boolean('debug', False, 'Enable debug mode.')
gflags.DEFINE_integer('page_size', 20, 'Search results per page.')

gflags.DEFINE_string('mongo_collection_name', 'records',
                     'MongoDB collection name.')

app = flask.Flask(__name__)
app.secret_key = str(datetime.datetime.now())
app.jinja_env.filters.update(display_util.utils)


{'fraction_non_alphanumeric': 0.1817636472705459, 'fraction_numerical': 0.01199760047990402, 'mean_word_length': 5.500974658869396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '2260565', 'n_tokens_mistral': 940, 'n_tokens_neox': 874, 'n_words': 327}