<commit_before># Copyright 2014 Scalyr Inc.
#
# 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.
# ------------------------------------------------------------------------
#
# author: <NAME> <<EMAIL>>
import scalyr_agent.json_lib.objects

__author__ = '<EMAIL>'

import os
import tempfile
from mock import patch, Mock

from scalyr_agent.configuration import Configuration, BadConfiguration
from scalyr_agent.json_lib import JsonObject, JsonArray
from scalyr_agent.json_lib import parse as parse_json, serialize as serialize_json
from scalyr_agent.monitors_manager import MonitorsManager
from scalyr_agent.platform_controller import DefaultPaths
from scalyr_agent.json_lib.objects import ArrayOfStrings
from scalyr_agent.test_util import FakePlatform

from scalyr_agent.test_base import ScalyrTestCase


class TestConfiguration(ScalyrTestCase):
    def setUp(self):
        self.original_os_env = dict([(k, v) for k, v in os.environ.iteritems()])
        self.__config_dir = tempfile.mkdtemp()
        self.__config_file = os.path.join(self.__config_dir, 'agent.json')
        self.__config_fragments_dir = os.path.join(self.__config_dir, 'agent.d')
        os.makedirs(self.__config_fragments_dir)
        for key in os.environ.keys():
            if 'scalyr' in key.lower():
                del os.environ[key]

    def tearDown(self):<commit_msg>Remove unused imports<commit_after># Copyright 2014 Scalyr Inc.
#
# 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.
# ------------------------------------------------------------------------
#
# author: <NAME> <<EMAIL>>
import scalyr_agent.json_lib.objects

__author__ = '<EMAIL>'

import os
import tempfile
from mock import patch, Mock

from scalyr_agent.configuration import Configuration, BadConfiguration
from scalyr_agent.json_lib import JsonObject, JsonArray
from scalyr_agent.json_lib import parse as parse_json, serialize as serialize_json
from scalyr_agent.platform_controller import DefaultPaths

from scalyr_agent.test_base import ScalyrTestCase


class TestConfiguration(ScalyrTestCase):
    def setUp(self):
        self.original_os_env = dict([(k, v) for k, v in os.environ.iteritems()])
        self.__config_dir = tempfile.mkdtemp()
        self.__config_file = os.path.join(self.__config_dir, 'agent.json')
        self.__config_fragments_dir = os.path.join(self.__config_dir, 'agent.d')
        os.makedirs(self.__config_fragments_dir)
        for key in os.environ.keys():
            if 'scalyr' in key.lower():
                del os.environ[key]

    def tearDown(self):
{'fraction_non_alphanumeric': 0.11864887879648027, 'fraction_numerical': 0.004541583877377235, 'mean_word_length': 3.4664131812420784, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6426154', 'n_tokens_mistral': 972, 'n_tokens_neox': 978, 'n_words': 331}