'Refresh library. Limit to URI and below if an URI is given.
:param uri: directory or track URI
:type uri: string'

def refresh(self, uri=None):

    ((uri is None) or validation.check_uri(uri))
    futures = {}
    backends = {}
    uri_scheme = (urllib.parse.urlparse(uri).scheme if uri else None)
    for (backend_scheme, backend) in self.backends.with_library.items():
        backends.setdefault(backend, set()).add(backend_scheme)
    for (backend, backend_schemes) in backends.items():
        if ((uri_scheme is None) or (uri_scheme in backend_schemes)):
            futures[backend] = backend.library.refresh(uri)
    for (backend, future) in futures.items():
        with _backend_error_handling(backend):
            future.get()
