'Convert the given ``filename`` to a URI relative to
this :class:`.TemplateCollection`.'

def filename_to_uri(self, filename):

    try:
        return self._uri_cache[filename]
    except KeyError:
        value = self._relativeize(filename)
        self._uri_cache[filename] = value
        return value
