def METHOD_NAME(
    keycloak_url,
    username,
    password,
    realm_name,
    client_id,
    verify=False,
    num_attempts=NUM_ATTEMPTS,
    timeout=TIMEOUT,
):
    for i in range(num_attempts):
        try:
            KeycloakAdmin(
                keycloak_url,
                username=username,
                password=password,
                realm_name=realm_name,
                client_id=client_id,
                verify=verify,
            )
            print(
                f"Attempt {i+1} succeeded connecting to keycloak master realm"
            )
            return True
        except KeycloakError:
            print(f"Attempt {i+1} failed connecting to keycloak master realm")
        time.sleep(timeout)
    return False