<commit_before>#!/usr/bin/python
#
# Copyright 2011, Infoblox, All Rights Reserved
#
# Open Source, see LICENSE
#

import urllib
from logging import getLogger

log = getLogger(__name__) # when imported, the logger will be named "ifmap.client"

# Import either httplib2 or urllib2 and map to same name
try:
	import httplib2 as http_client_lib
	Http = http_client_lib.Http
	HttpException = http_client_lib.HttpLib2Error
	import urllib2 as http_client_lib
        HttpException = (http_client_lib.URLError, http_client_lib.HTTPError)
        class Http(): # wrapper to use when httplib2 not available
                def request(self, url, method, body, headers):
                        f = http_client_lib.urlopen(http_client_lib.Request(url, body, headers))
                        return f.info(), f.read()

except ImportError:
	import urllib2 as http_client_lib
	HttpException = (http_client_lib.URLError, http_client_lib.HTTPError)
	class Http(): # wrapper to use when httplib2 not available
		def request(self, url, method, body, headers):
			f = http_client_lib.urlopen(http_client_lib.Request(url, body, headers))
			return f.info(), f.read()

namespaces = {
	'env'   :   "http://www.w3.org/2003/05/soap-envelope",
	'ifmap' :   "http://www.trustedcomputinggroup.org/2010/IFMAP/2",
	'meta'  :   "http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2",
}

class client:
	"""
	IF-MAP client<commit_msg> swapping httplib2 with urllib2 imports<commit_after>#!/usr/bin/python
#
# Copyright 2011, Infoblox, All Rights Reserved
#
# Open Source, see LICENSE
#

import urllib
from logging import getLogger

log = getLogger(__name__) # when imported, the logger will be named "ifmap.client"

# Import either httplib2 or urllib2 and map to same name
try:
	import urllib2 as http_client_lib
        HttpException = (http_client_lib.URLError, http_client_lib.HTTPError)
        class Http(): # wrapper to use when httplib2 not available
                def request(self, url, method, body, headers):
                        f = http_client_lib.urlopen(http_client_lib.Request(url, body, headers))
                        return f.info(), f.read()

except ImportError:
	import httplib2 as http_client_lib
        Http = http_client_lib.Http
        HttpException = http_client_lib.HttpLib2Error

namespaces = {
	'env'   :   "http://www.w3.org/2003/05/soap-envelope",
	'ifmap' :   "http://www.trustedcomputinggroup.org/2010/IFMAP/2",
	'meta'  :   "http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2",
}

class client:
	"""
	IF-MAP client
{'fraction_non_alphanumeric': 0.10433070866141732, 'fraction_numerical': 0.02283464566929134, 'mean_word_length': 3.5133214920071048, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '7508393', 'n_tokens_mistral': 885, 'n_tokens_neox': 842, 'n_words': 209}