parameters: (self, host, timeout=300)
return_statement: return httplib.HTTPSConnection(host)
docstring: Connection method
docstring_summary: Connection method
docstring_tokens: Connection method
function: def get_connection(self, host, timeout=300):
          """Connection method"""
          if  self.key and self.cert and not self.capath:
              return httplib.HTTPSConnection(host, key_file=self.key,
                                                  cert_file=self.cert)
          elif self.cert and self.capath:
              context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
              context.load_verify_locations(capath=self.capath)
              context.load_cert_chain(self.cert)
              return httplib.HTTPSConnection(host, context=context)
          return httplib.HTTPSConnection(host)
function_tokens: def get_connection ( self , host , timeout = 300 ) : if self . key and self . cert and not self . capath : return httplib . HTTPSConnection ( host , key_file = self . key , cert_file = self . cert ) elif self . cert and self . capath : context = ssl . SSLContext ( ssl . PROTOCOL_TLSv1 ) context . load_verify_locations ( capath = self . capath ) context . load_cert_chain ( self . cert ) return httplib . HTTPSConnection ( host , context = context ) return httplib . HTTPSConnection ( host )