def flush_django_cache(cache_instance=None):
    cache_instance = cache_instance
    if not cache_instance:
        from django.core.cache import cache
        cache_instance = cache

    try:
        cache_instance.clear()
    except __HOLE__:
        # Django < 1.2, backport
        backend_name = cache_instance.__module__.split(".")[-1:][0]

        if backend_name not in BACKEND_CLEAR_MAP:
            raise ValueError("Don't know how to clear cache for %s backend" % backend_name)

        BACKEND_CLEAR_MAP[backend_name](cache_instance)
dataset/ETHPy150Open Almad/django-sane-testing/djangosanetesting/cache.py/flush_django_cache