<commit_before># No shebang line, this module is meant to be imported
#
# Copyright 2013 <NAME>
#
# 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.

"""
Config
======

Base configuration classes for the Flask application
"""

import os
from uuid import uuid4
from warnings import warn
from pyfarm.core.warning import ConfigurationWarning


def get_secret_key(warning=True):
    """
    Gets the secret key to use.  This is done outside the class so we can
    suppress the warning
    """
    if "PYFARM_SECRET_KEY" in os.environ:
        return os.environ["PYFARM_SECRET_KEY"]
    else:
        if warning:
            warn("$PYFARM_SECRET_KEY not present in environment",
                 ConfigurationWarning)

        return str(uuid4()).replace("-", "").decode("hex")


class _Prod(object):
    """core production configuration"""
    DEBUG = False
    SECRET_KEY = property(fget=lambda self: get_secret_key())

<commit_msg>should be using EnvironmentWarning<commit_after># No shebang line, this module is meant to be imported
#
# Copyright 2013 <NAME>
#
# 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.

"""
Config
======

Base configuration classes for the Flask application
"""

import os
from uuid import uuid4
from warnings import warn
from pyfarm.core.warning import EnvironmentWarning



def get_secret_key(warning=True):
    """
    Gets the secret key to use.  This is done outside the class so we can
    suppress the warning
    """
    if "PYFARM_SECRET_KEY" in os.environ:
        return os.environ["PYFARM_SECRET_KEY"]
    elif warning:
        warn("$PYFARM_SECRET_KEY not present in environment",
             EnvironmentWarning)

        return str(uuid4()).replace("-", "").decode("hex")


class _Prod(object):
    """core production configuration"""
    DEBUG = False
    SECRET_KEY = property(fget=lambda self: get_secret_key())


{'fraction_non_alphanumeric': 0.08550316678395496, 'fraction_numerical': 0.007037297677691766, 'mean_word_length': 3.7383333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2941490', 'n_tokens_mistral': 784, 'n_tokens_neox': 777, 'n_words': 328}