def resolve_source_to_url(self, ctx, filepath, item):
        request = get_current_request()

        # Use the filepath to reconstruct the item without globs
        package, _ = self._split_spec(item)
        if package is not None:
            pkgdir = self._resolve_spec(package + ':')
            if filepath.startswith(pkgdir):
                item = '{}:{}'.format(package, filepath[len(pkgdir):])

        # Attempt to resolve the filepath as passed (but after versioning).
        # If this fails, it may be because the static route was registered
        # with an asset spec. In this case, the original item may also be
        # an asset spec contained therein, so try to resolve that.
        if request is not None:
            for attempt in (filepath, item):
                try:
                    return request.static_url(attempt)
                except __HOLE__:
                    pass

        if USING_WEBASSETS_CONTEXT:
            return super(PyramidResolver, self).resolve_source_to_url(
                ctx,
                filepath,
                item
            )
        else:  # pragma: no cover
            return super(PyramidResolver, self).resolve_source_to_url(
                filepath,
                item
            )
dataset/ETHPy150Open sontek/pyramid_webassets/pyramid_webassets/__init__.py/PyramidResolver.resolve_source_to_url