

def url_to_destination_params(url):
    'Convert a legacy runner URL to a job destination\n\n    >>> params_simple = url_to_destination_params("http://localhost:8913/")\n    >>> params_simple["url"]\n    \'http://localhost:8913/\'\n    >>> params_simple["private_token"] is None\n    True\n    >>> advanced_url = "https://1234x@example.com:8914/managers/longqueue"\n    >>> params_advanced = url_to_destination_params(advanced_url)\n    >>> params_advanced["url"]\n    \'https://example.com:8914/managers/longqueue/\'\n    >>> params_advanced["private_token"]\n    \'1234x\'\n    >>> runner_url = "pulsar://http://localhost:8913/"\n    >>> runner_params = url_to_destination_params(runner_url)\n    >>> runner_params[\'url\']\n    \'http://localhost:8913/\'\n    '
    if url.startswith('pulsar://'):
        url = url[len('pulsar://'):]
    if (not url.endswith('/')):
        url += '/'
    private_token_format = 'https?://(.*)@.*/?'
    private_token_match = match(private_token_format, url)
    private_token = None
    if private_token_match:
        private_token = private_token_match.group(1)
        url = url.replace(('%s@' % private_token), '', 1)
    destination_args = {
        'url': url,
        'private_token': private_token,
    }
    return destination_args

dataset/ETHPy150Open galaxyproject/pulsar/pulsar/client/destination.py url_to_destination_params/original