def METHOD_NAME(path_string, base_url=settings.MEDIA_URL):
    if not hasattr(
            settings,
            'ENABLE_MEDIA_VERSIONING') or not settings.ENABLE_MEDIA_VERSIONING:
        return base_url + path_string
    try:
        if path_string in version_cache:
            mtime = version_cache[path_string]
        else:
            mtime = os.path.getmtime(os.path.join(settings.MEDIA_ROOT,
                                                  path_string))
            version_cache[path_string] = mtime
        return base_url + rx.sub(r'\1.%d.\2' % mtime, path_string)
    except Exception:
        return base_url + path_string