def run_only_if_redis_is_available(func):
 try:
  import redis
 except ImportError:
  redis = None
 pred = (lambda : (redis is not None))
 return run_only(func, pred)

def run_only_if_redis_is_available ( func ) : try : import redis except ImportError : redis = None pred = ( lambda : ( redis is not None ) ) return run_only ( func , pred )
decorator for checking if python-redis is available .