def _server_url(server):
if not _HTTP_PAT.match(server):<EOL><INDENT>server = '<STR_LIT>' % server<EOL><DEDENT>parsed = urlparse(server)<EOL>url = '<STR_LIT>' % (parsed.scheme, parsed.netloc)<EOL>return url<EOL>
Normalizes a given server string to an url

>>> print(_server_url('a'))
http://a
>>> print(_server_url('a:9345'))
http://a:9345
>>> print(_server_url('https://a:9345'))
https://a:9345
>>> print(_server_url('https://a'))
https://a
>>> print(_server_url('demo.crate.io'))
http://demo.crate.io