def resolve_connection(connection=None):
 if (connection is not None):
  return patch_connection(connection)
 connection = get_current_connection()
 if (connection is None):
  raise NoRedisConnectionException(u'Could not resolve a Redis connection')
 return connection

def resolve_connection ( connection = None ) : if ( connection is not None ) : return patch_connection ( connection ) connection = get_current_connection ( ) if ( connection is None ) : raise NoRedisConnectionException ( u'Could not resolve a Redis connection' ) return connection
convenience function to resolve the given or the current connection .