def bytes_to_str(data):
    """ 二进制类型转换为字符串，支持嵌套数组。bytes to string, supports nested list.

    Examples::

        string_value = bytes_to_str(redis.get('key'))
        values = bytes_to_str(redis.mget(*keys))
    """
    if data is None:
        return data
    if isinstance(data, bytes):
        return data.decode()
    if isinstance(data, str):
        return data
    return [bytes_to_str(_) for _ in data]