<commit_before>import pytest
import json
import datetime

try:
  from urlparse import parse_qs
except:
  from urllib.parse import parse_qs

try:
  from urlparse import urlparse
except ImportError:
  from urllib.parse import urlparse

import KISSmetrics


class TestKISSmetricsClient(object):

    def setup(self):
        self.client = KISSmetrics.Client(key='foo')

    def test_client_key(self):
        assert self.client.key == 'foo'

    def test_client_http_object(self):
        http = self.client.http
        assert http.request('GET', 'http://httpbin.org').status == 200

    def test_client_protocol(self):
        with pytest.raises(ValueError):
            client = KISSmetrics.Client(key='foo', trk_proto='ssh')


class TestKISSmetricsClientCompat(object):

    def setup(self):
        self.client = KISSmetrics.ClientCompat(key='foo')<commit_msg>Fix indentation of import statements<commit_after>import pytest
import json
import datetime

try:
    from urlparse import parse_qs
except:
    from urllib.parse import parse_qs

try:
    from urlparse import urlparse
except ImportError:
    from urllib.parse import urlparse

import KISSmetrics


class TestKISSmetricsClient(object):

    def setup(self):
        self.client = KISSmetrics.Client(key='foo')

    def test_client_key(self):
        assert self.client.key == 'foo'

    def test_client_http_object(self):
        http = self.client.http
        assert http.request('GET', 'http://httpbin.org').status == 200

    def test_client_protocol(self):
        with pytest.raises(ValueError):
            client = KISSmetrics.Client(key='foo', trk_proto='ssh')


class TestKISSmetricsClientCompat(object):

    def setup(self):
        self.client = KISSmetrics.ClientCompat(key='foo')
{'fraction_non_alphanumeric': 0.09686609686609686, 'fraction_numerical': 0.003418803418803419, 'mean_word_length': 3.633245382585752, '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': '3069807', 'n_tokens_mistral': 556, 'n_tokens_neox': 525, 'n_words': 125}