def _graceful_relative_url(base_url, url):
    if url == base_url:
        return ''
    base_prefix = '%s://%s' % urlparse.urlparse(base_url or '')[0:2]
    url_prefix = '%s://%s' % urlparse.urlparse(url or '')[0:2]
    if base_prefix == url_prefix and url_prefix != '://':
        return url[len(url_prefix):]
    return url
Return a graceful link for a URL relative to a base URL.
dataset/ETHPy150Open core-api/python-client/coreapi/codecs/corejson.py/_graceful_relative_url