def prepend_http(url):
    """ Ensure there's a scheme specified at the beginning of a url, defaulting to http://

    >>> prepend_http('duckduckgo.com')
    'http://duckduckgo.com'
    """
    url = url.lstrip()
    if not urlparse(url).scheme:
        return 'http://' + url
    return url
Ensure there's a scheme specified at the beginning of a url, defaulting to http://

    >>> prepend_http('duckduckgo.com')
    'http://duckduckgo.com'