<commit_before># vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Hewlett Packard Development Company, L.P.
# All Rights Reserved.
#
#    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.
"""
HP3Par HTTP Client
:Author: <NAME>
:Description: This is the HTTP Client that is used to make the actual calls. IT includes the authentication that knows the cookie name for 3PAR.

"""

import logging
import os
import urlparse
import httplib2
import time
import pprint

try:
    import json
except ImportError:
    import simplejson as json

from hp3parclient import exceptions

class HTTPJSONRESTClient(httplib2.Http):
    """ 
    An HTTP REST Client that sends and recieves JSON data as the body of the HTTP request

    :param api_url: The url to the WSAPI service on 3PAR ie. http://<3par server>:8008/api/v1
    :type api_url: str
    :param insecure: Use https? requires a local certificate
    :type insecure: bool

    """

    USER_AGENT = 'python-3parclient'
    SESSION_COOKIE_NAME = 'X-Hp3Par-Wsapi-Sessionkey'

    def __init__(self, api_url, insecure=False, http_log_debug=False):
        super(HTTPJSONRESTClient, self).__init__(disable_ssl_certificate_validation=True)

        self.session_key = None

        #should be http://<Server:Port>/api/v1<commit_msg>small docs fixes<commit_after># vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Hewlett Packard Development Company, L.P.
# All Rights Reserved.
#
#    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.
"""
HP3Par HTTP Client
:Author: <NAME> IV
:Description: This is the HTTP Client that is used to make the actual calls. 
 It includes the authentication that knows the cookie name for 3PAR.

"""

import logging
import os
import urlparse
import httplib2
import time
import pprint

try:
    import json
except ImportError:
    import simplejson as json

from hp3parclient import exceptions

class HTTPJSONRESTClient(httplib2.Http):
    """ 
    An HTTP REST Client that sends and recieves JSON data as the body of the HTTP request

    :param api_url: The url to the WSAPI service on 3PAR 
                    ie. http://<3par server>:8080/api/v1
    :type api_url: str
    :param insecure: Use https? requires a local certificate
    :type insecure: bool

    """

    USER_AGENT = 'python-3parclient'
    SESSION_COOKIE_NAME = 'X-Hp3Par-Wsapi-Sessionkey'

    def __init__(self, api_url, insecure=False, http_log_debug=False):
        super(HTTPJSONRESTClient, self).__init__(disable_ssl_certificate_validation=True)

        self.session_key = None

        #should be http://<Server:Port>/api/v1
{'fraction_non_alphanumeric': 0.07223600771987869, 'fraction_numerical': 0.014336917562724014, 'mean_word_length': 3.609911054637865, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3472785', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1023, 'n_words': 422}