def _newConnection(self, key, endpoint):
        """
        Create a new connection.

        This implements the new connection code path for L{getConnection}.
        """
        def quiescentCallback(protocol):
            self._putConnection(key, protocol)
        factory = self._factory(quiescentCallback, repr(endpoint))
        return endpoint.connect(factory)

        Create a new connection.

        This implements the new connection code path for L{getConnection}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/client.py