def __init__(self, cfg_file, url=None, token=None, ca=None,
                 insecure_skip_tls_verify=False, version="/v1"):
        """
        Creates a new instance of the HTTPClient.

        :Parameters:
           - `cfg_file`: Kubectl config file (useful for testing)
           - `token`: Useful for service account
           - `version`: The version of the API to use
        """
        self.url = url
        self.token = token
        self.insecure_skip_tls_verify = insecure_skip_tls_verify
        self.ca = ca
        if cfg_file:
            self.config = K8sConfig(cfg_file)
            self.config.parse()
            self.url = self.config.cluster["server"]
            self.token = self.config.user["token"]
            if "certificate-authority" in self.config.cluster:
                self.ca = self.config.cluster["certificate-authority"]
            elif self.config.cluster.get('insecure-skip-tls-verify'):
                self.insecure_skip_tls_verify = True
            # TODO handle client cert
        self.version = version
        self.session = self.build_session()
dataset/ETHPy150Open chiradeep/nitrox/kubernetes/client.py/K8sClient.__init__/original