def parse_url(url, encoding=None):
    """Return urlparsed url from the given argument (which could be an already
    parsed url)
    """
    if isinstance(url, ParseResult):
        return url
    return urlparse(to_unicode(url, encoding))
Return urlparsed url from the given argument (which could be an already
    parsed url)
    
stackoverflow/venv/lib/python3.6/site-packages/scrapy/utils/url.py