def METHOD_NAME(context, name, group, key, value, time_limit):
    time_limit *= context.timeout_multiplier
    max_time = time.time() + int(time_limit)
    dcs_value = None
    response = None
    while time.time() < max_time:
        try:
            response = json.loads(context.dcs_ctl.query(name, group=group))
            dcs_value = response.get(key)
            if dcs_value == value:
                return
        except Exception:
            pass
        time.sleep(1)
    assert False, ("{0} in a group {1} does not have {2}={3} (found {4}) in dcs"
                   " after {5} seconds").format(name, group, key, value, response, time_limit)