def aiocache_enabled(cls, fake_return=None):
        """
        Use this decorator to be able to fake the return of the function by setting the
        ``AIOCACHE_DISABLE`` environment variable
        """

        def enabled(func):
            @functools.wraps(func)
            async def _enabled(*args, **kwargs):
                if os.getenv("AIOCACHE_DISABLE") == "1":
                    return fake_return
                return await func(*args, **kwargs)

            return _enabled

        return enabled
def aiocache_enabled ( cls , fake_return = None ) : def enabled ( func ) : @ functools . wraps ( func ) async def _enabled ( * args , ** kwargs ) : if os . getenv ( "AIOCACHE_DISABLE" ) == "1" : return fake_return return await func ( * args , ** kwargs ) return _enabled return enabled
Use this decorator to be able to fake the return of the function by setting the
        ``AIOCACHE_DISABLE`` environment variable