def get_path_or_url(location):
    """Return the path or URL associated with location

    location is a dict with 'scheme', 'path', and 'resource_name' (like what's
    yielded by registry.get_locations). Note that for local (neurobank)
    locations, the resource may have an extension; this is not included.

    """
    from nbank.archive import resource_path
    try:
        from urllib.parse import urlunparse
    except ImportError:
        from urlparse import urlunparse
    if location['scheme'] == 'neurobank':
        return resource_path(location['root'], location['resource_name'])
    else:
        return urlunparse((location['scheme'], location['root'], location[
            'resource_name'], '', '', ''))
