def _get_connection(self, uri, headers=None):
    connection = None
    if uri.scheme == 'https':
      if not uri.port:
        connection = httplib.HTTPSConnection(uri.host)
      else:
        connection = httplib.HTTPSConnection(uri.host, int(uri.port))
    else:
      if not uri.port:
        connection = httplib.HTTPConnection(uri.host)
      else:
        connection = httplib.HTTPConnection(uri.host, int(uri.port))
    return connection
Opens a socket connection to the server to set up an HTTP request.
dataset/ETHPy150Open CollabQ/CollabQ/vendor/atom/http_core.py/HttpClient._get_connection