def resolve_storage_info(config, storage_ref):

    # first check if it's already a valid URL
    urlcomps = urlparse(storage_ref)
    if not urlcomps.scheme == '':
        return {'url': storage_ref}

    # check if it's in the config
    storage_info = config.storages.get(storage_ref)
    if storage_info is not None:
        return storage_info

    # assume it's a path and convert to file url
    path = canonical_path(storage_ref)
    return {'url': 'file://%s' % (path)}
dataset/ETHPy150Open mindsnacks/Zinc/src/zinc/cli.py/resolve_storage_info/original