def get_script_url_from_initiator(initiator):
    """Remove the scheme and query section of a URL."""
    if initiator:
        return initiator.rsplit(':', 2)[0].split('@')[-1].split(' line')[0]
    else:
        return ''
