# Path: aredis/utils.py
# def dict_merge(*dicts):
#     merged = {}
#     for d in dicts:
#         merged.update(d)
#     return merged
# 
# def nativestr(x):
#     return x if isinstance(x, str) else x.decode('utf-8', 'replace')
# 
# def list_keys_to_dict(key_list, callback):
#     return dict.fromkeys(key_list, callback)
# 
# class NodeFlag:
#     BLOCKED = 'blocked'
#     ALL_NODES = 'all-nodes'
#     ALL_MASTERS = 'all-masters'
#     RANDOM = 'random'
#     SLOT_ID = 'slot-id'
# 
# def bool_ok(response):
#     return nativestr(response) == 'OK'


import warnings
from aredis.utils import (dict_merge, nativestr,
                          list_keys_to_dict,
                          NodeFlag, bool_ok)
        result[name] = flag in flags
    return result


def parse_sentinel_master(response):
    return parse_sentinel_state(map(nativestr, response))


def parse_sentinel_masters(response):
    result = {}
    for item in response:
        state = parse_sentinel_state(map(nativestr, item))
        result[state['name']] = state
    return result


def parse_sentinel_slaves_and_sentinels(response):
    return [parse_sentinel_state(map(nativestr, item)) for item in response]


def parse_sentinel_get_master(response):
    return response and (response[0], int(response[1])) or None


class SentinelCommandMixin:
    RESPONSE_CALLBACKS = {
        'SENTINEL GET-MASTER-ADDR-BY-NAME': parse_sentinel_get_master,
        'SENTINEL MASTER': parse_sentinel_master,
        'SENTINEL MASTERS': parse_sentinel_masters,
        'SENTINEL MONITOR': bool_ok,

# Path: aredis/utils.py
# def dict_merge(*dicts):
#     merged = {}
#     for d in dicts:
#         merged.update(d)
#     return merged
# 
# def nativestr(x):
#     return x if isinstance(x, str) else x.decode('utf-8', 'replace')
# 
# def list_keys_to_dict(key_list, callback):
#     return dict.fromkeys(key_list, callback)
# 
# class NodeFlag:
#     BLOCKED = 'blocked'
#     ALL_NODES = 'all-nodes'
#     ALL_MASTERS = 'all-masters'
#     RANDOM = 'random'
#     SLOT_ID = 'slot-id'
# 
# def bool_ok(response):
#     return nativestr(response) == 'OK'


# Path: aredis/commands/sentinel.py
import warnings
from aredis.utils import (dict_merge, nativestr,
                          list_keys_to_dict,
                          NodeFlag, bool_ok)

        result[name] = flag in flags
    return result


def parse_sentinel_master(response):
    return parse_sentinel_state(map(nativestr, response))


def parse_sentinel_masters(response):
    result = {}
    for item in response:
        state = parse_sentinel_state(map(nativestr, item))
        result[state['name']] = state
    return result


def parse_sentinel_slaves_and_sentinels(response):
    return [parse_sentinel_state(map(nativestr, item)) for item in response]


def parse_sentinel_get_master(response):
    return response and (response[0], int(response[1])) or None


class SentinelCommandMixin:
    RESPONSE_CALLBACKS = {
        'SENTINEL GET-MASTER-ADDR-BY-NAME': parse_sentinel_get_master,
        'SENTINEL MASTER': parse_sentinel_master,
        'SENTINEL MASTERS': parse_sentinel_masters,
        'SENTINEL MONITOR': bool_ok,

        'SENTINEL REMOVE': bool_ok,