def use_connection(redis=None):
 assert (len(_connection_stack) <= 1), u'You should not mix Connection contexts with use_connection()'
 release_local(_connection_stack)
 if (redis is None):
  redis = StrictRedis()
 push_connection(redis)

def use_connection ( redis = None ) : assert ( len ( _connection_stack ) <= 1 ) , u'You should not mix Connection contexts with use_connection()' release_local ( _connection_stack ) if ( redis is None ) : redis = StrictRedis ( ) push_connection ( redis )
clears the stack and uses the given connection .