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


from aredis.utils import (bool_ok,
                          nativestr,
                          NodeFlag,
                          list_keys_to_dict,
                          dict_merge)
from aredis.exceptions import (RedisError,
                               ClusterError)


def parse_cluster_info(response, **options):
    response = nativestr(response)
    return dict([line.split(':') for line in response.splitlines() if line])


def parse_cluster_nodes(resp, **options):
    """
    @see: http://redis.io/commands/cluster-nodes  # string
    @see: http://redis.io/commands/cluster-slaves # list of string
    """
    if isinstance(resp, list):
        resp = [nativestr(row) for row in resp]
    else:

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


# Path: aredis/commands/cluster.py
from aredis.utils import (bool_ok,
                          nativestr,
                          NodeFlag,
                          list_keys_to_dict,
                          dict_merge)
from aredis.exceptions import (RedisError,
                               ClusterError)



def parse_cluster_info(response, **options):
    response = nativestr(response)
    return dict([line.split(':') for line in response.splitlines() if line])


def parse_cluster_nodes(resp, **options):
    """
    @see: http://redis.io/commands/cluster-nodes  # string
    @see: http://redis.io/commands/cluster-slaves # list of string
    """
    if isinstance(resp, list):
        resp = [nativestr(row) for row in resp]
    else:

        resp = nativestr(resp)