# Path: aredis/exceptions.py
# class RedisError(Exception):
#     pass
# 
# Path: aredis/utils.py
# def b(x):
#     return x.encode('latin-1') if not isinstance(x, bytes) else x
# 
# def bool_ok(response):
#     return nativestr(response) == 'OK'
# 
# def nativestr(x):
#     return x if isinstance(x, str) else x.decode('utf-8', 'replace')
# 
# def dict_merge(*dicts):
#     merged = {}
#     for d in dicts:
#         merged.update(d)
#     return merged
# 
# def string_keys_to_dict(key_string, callback):
#     return dict.fromkeys(key_string.split(), callback)
# 
# def list_keys_to_dict(key_list, callback):
#     return dict.fromkeys(key_list, callback)
# 
# def pairs_to_dict(response):
#     """Creates a dict given a list of key/value pairs"""
#     it = iter(response)
#     return dict(zip(it, it))
# 
# class NodeFlag:
#     BLOCKED = 'blocked'
#     ALL_NODES = 'all-nodes'
#     ALL_MASTERS = 'all-masters'
#     RANDOM = 'random'
#     SLOT_ID = 'slot-id'


import datetime
from aredis.exceptions import RedisError
from aredis.utils import (b, bool_ok,
                          nativestr, dict_merge,
                          string_keys_to_dict,
                          list_keys_to_dict,
                          pairs_to_dict,
                          NodeFlag)
                'offset': int(offset)
            })
        return res

    def _parse_slave(response):
        host, port, status, offset = response[1:]
        return {
            'role': role,
            'host': host,
            'port': port,
            'status': status,
            'offset': offset
        }

    def _parse_sentinel(response):
        return {
            'role': role,
            'masters': response[1:]
        }
    parser = {
        'master': _parse_master,
        'slave': _parse_slave,
        'sentinel': _parse_sentinel
    }[role]
    return parser(response)


class ServerCommandMixin:
    RESPONSE_CALLBACKS = dict_merge(
        string_keys_to_dict('BGREWRITEAOF BGSAVE', lambda r: True),

# Path: aredis/exceptions.py
# class RedisError(Exception):
#     pass
# 
# Path: aredis/utils.py
# def b(x):
#     return x.encode('latin-1') if not isinstance(x, bytes) else x
# 
# def bool_ok(response):
#     return nativestr(response) == 'OK'
# 
# def nativestr(x):
#     return x if isinstance(x, str) else x.decode('utf-8', 'replace')
# 
# def dict_merge(*dicts):
#     merged = {}
#     for d in dicts:
#         merged.update(d)
#     return merged
# 
# def string_keys_to_dict(key_string, callback):
#     return dict.fromkeys(key_string.split(), callback)
# 
# def list_keys_to_dict(key_list, callback):
#     return dict.fromkeys(key_list, callback)
# 
# def pairs_to_dict(response):
#     """Creates a dict given a list of key/value pairs"""
#     it = iter(response)
#     return dict(zip(it, it))
# 
# class NodeFlag:
#     BLOCKED = 'blocked'
#     ALL_NODES = 'all-nodes'
#     ALL_MASTERS = 'all-masters'
#     RANDOM = 'random'
#     SLOT_ID = 'slot-id'


# Path: aredis/commands/server.py
import datetime
from aredis.exceptions import RedisError
from aredis.utils import (b, bool_ok,
                          nativestr, dict_merge,
                          string_keys_to_dict,
                          list_keys_to_dict,
                          pairs_to_dict,
                          NodeFlag)

                'offset': int(offset)
            })
        return res

    def _parse_slave(response):
        host, port, status, offset = response[1:]
        return {
            'role': role,
            'host': host,
            'port': port,
            'status': status,
            'offset': offset
        }

    def _parse_sentinel(response):
        return {
            'role': role,
            'masters': response[1:]
        }
    parser = {
        'master': _parse_master,
        'slave': _parse_slave,
        'sentinel': _parse_sentinel
    }[role]
    return parser(response)


class ServerCommandMixin:
    RESPONSE_CALLBACKS = dict_merge(
        string_keys_to_dict('BGREWRITEAOF BGSAVE', lambda r: True),

        string_keys_to_dict(