def is_locked(lock):
    """For use on a redis-py lock. Returns True if locked, False if not."""
    if lock.acquire(blocking=False):
        lock.release()
        return False
    else:
        return True