def connection_from_host(self, host, port=None, scheme='<STR_LIT:http>'):
if not host:<EOL><INDENT>raise LocationValueError("<STR_LIT>")<EOL><DEDENT>scheme = scheme or '<STR_LIT:http>'<EOL>port = port or port_by_scheme.get(scheme, <NUM_LIT>)<EOL>pool_key = (scheme, host, port)<EOL>with self.pools.lock:<EOL><INDENT>pool = self.pools.get(pool_key)<EOL>if pool:<EOL><INDENT>return pool<EOL><DEDENT>pool = self._new_pool(scheme, host, port)<EOL>self.pools[pool_key] = pool<EOL><DEDENT>return pool<EOL>
Get a :class:`ConnectionPool` based on the host, port, and scheme.

If ``port`` isn't given, it will be derived from the ``scheme`` using
``urllib3.connectionpool.port_by_scheme``.