def replace_url(self, url):
        if url.startswith('data:'):
            # Don't even both sending data: through urlparse(),
            # who knows how well it'll deal with a lot of data.
            return

        # Ignore any urls which are not relative
        parsed = urlparse.urlparse(url)
        if parsed.scheme or parsed.netloc or parsed.path.startswith('/'):
            return

        # Since this runs BEFORE cssrewrite, we can thus assume that urls
        # will be relative to the file location.
        #
        # Notes:
        #  - Django might need to override this filter for staticfiles if it
        #    it should be possible to resolve cross-references between
        #    different directories.
        #  - For Flask-Assets blueprints, the logic might need to be:
        #    1) Take source_path, convert into correct url via absurl().
        #    2) Join with the URL be be replaced.
        #    3) Convert url back to the filesystem path to which the url
        #       would map (the hard part?).
        #

        filename = os.path.join(os.path.dirname(self.source_path), url)

        try:
            if os.stat(filename).st_size <= (self.max_size or 2048):
                with open(filename, 'rb') as f:
                    data = b64encode(f.read())
                return 'data:%s;base64,%s' % (
                    mimetypes.guess_type(filename)[0], data.decode())
        except (__HOLE__, IOError):
            # Ignore the file not existing.
            # TODO: When we have a logging system, this could produce a warning
            return
dataset/ETHPy150Open miracle2k/webassets/src/webassets/filter/datauri.py/CSSDataUri.replace_url