<commit_before>#!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
#

import unittest

import time

import pytz
import six

if six.PY2:
    import thread
else:
    import _thread as thread

try:
    from urllib import urlencode
    from urllib2 import urlopen
    from urllib2 import Request
    from urllib2 import HTTPError
except ImportError:
    from urllib.parse import urlencode
    from urllib.request import urlopen
    from urllib.error import HTTPError

from datetime import datetime

_server_started = False

class TestHttpRpc(unittest.TestCase):
    def setUp(self):
        global _server_started

        if not _server_started:
            def run_server():
                from spyne.test.interop.server.httprpc_pod_basic import main
                main()

            thread.start_new_thread(run_server, ())
<commit_msg>more python 3 import fixes  #113<commit_after>#!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
#

import unittest

import time

import pytz
import six

if six.PY2:
    import thread

    from urllib import urlencode
    from urllib2 import urlopen
    from urllib2 import Request
    from urllib2 import HTTPError
else:
    import _thread as thread

    from urllib.parse import urlencode
    from urllib.request import urlopen
    from urllib.request import Request
    from urllib.error import HTTPError

from datetime import datetime

_server_started = False

class TestHttpRpc(unittest.TestCase):
    def setUp(self):
        global _server_started

        if not _server_started:
            def run_server():
                from spyne.test.interop.server.httprpc_pod_basic import main
                main()

            thread.start_new_thread(run_server, ())

{'fraction_non_alphanumeric': 0.05137844611528822, 'fraction_numerical': 0.011904761904761904, 'mean_word_length': 3.362021857923497, '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': '4919424', 'n_tokens_mistral': 897, 'n_tokens_neox': 862, 'n_words': 392}