'Creates a new HttpRpcServerHttpLib2.
Args:
host: The host to send requests to.
auth_function: Saved but ignored; may be used by subclasses.
user_agent: The user-agent string to send to the server. Specify None to
omit the user-agent header.
source: Saved but ignored; may be used by subclasses.
host_override: The host header to send to the server (defaults to host).
extra_headers: A dict of extra headers to append to every request. Values
supplied here will override other default headers that are supplied.
save_cookies: Saved but ignored; may be used by subclasses.
auth_tries: The number of times to attempt auth_function before failing.
account_type: Saved but ignored; may be used by subclasses.
debug_data: Whether debugging output should include data contents.
secure: If the requests sent using Send should be sent over HTTPS.
ignore_certs: If the certificate mismatches should be ignored.
rpc_tries: The number of rpc retries upon http server error (i.e.
Response code >= 500 and < 600) before failing.
conflict_max_errors: The number of rpc retries upon http server error
(i.e. Response code 409) before failing.
timeout_max_errors: The number of rpc retries upon http server timeout
(i.e. Response code 408) before failing.
http_class: the httplib2.Http subclass to use. Defaults to httplib2.Http.'

def __init__(self, host, auth_function, user_agent, source, host_override=None, extra_headers=None, save_cookies=False, auth_tries=None, account_type=None, debug_data=True, secure=True, ignore_certs=False, rpc_tries=3, conflict_max_errors=10, timeout_max_errors=2, http_class=None):

    self.host = host
    self.auth_function = auth_function
    self.user_agent = user_agent
    self.source = source
    self.host_override = host_override
    self.extra_headers = (extra_headers or {})
    self.save_cookies = save_cookies
    self.auth_max_errors = auth_tries
    self.account_type = account_type
    self.debug_data = debug_data
    self.secure = secure
    self.ignore_certs = ignore_certs
    self.rpc_max_errors = rpc_tries
    self.scheme = ((secure and 'https') or 'http')
    self.conflict_max_errors = conflict_max_errors
    self.timeout_max_errors = timeout_max_errors
    self.http_class = (http_class if (http_class is not None) else httplib2.Http)
    self.certpath = None
    self.cert_file_available = False
    if (not self.ignore_certs):
        self.certpath = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'lib', 'cacerts', 'cacerts.txt'))
        self.cert_file_available = os.path.exists(self.certpath)
    self.memory_cache = MemoryCache()
