def _is_redis_running(coord_url: str) -> bool:
    """Connect to redis with connection logic that mirrors the st2 code.

    In particular, this is based on:
      - st2common.services.coordination.coordinator_setup()

    This should not import the st2 code as it should be self-contained.
    """
    # late import so that __file__ can be imported in the pants plugin without these imports
    from tooz import ToozError, coordination

    member_id = "pants-uses_services-redis"
    coordinator = coordination.get_coordinator(coord_url, member_id)
    try:
        coordinator.start(start_heart=False)
    except ToozError:
        return False
    return True
Connect to redis with connection logic that mirrors the st2 code.

    In particular, this is based on:
      - st2common.services.coordination.coordinator_setup()

    This should not import the st2 code as it should be self-contained.
    
pants-plugins/uses_services/scripts/is_redis_running.py