# Path: deepstreampy/utils.py
# class SingleNotifier(object):
# class Listener(object):
# class ResubscribeNotifier(object):
# class AckTimeoutRegistry(EventEmitter):
# class Undefined(object):
#     def __init__(self, client, connection, topic, action, timeout_duration):
#     def has_request(self, name):
#     def request(self, name, callback):
#     def receive(self, name, error, data):
#     def _on_response_timeout(self, name):
#     def _resend_requests(self):
#     def __init__(self, listener_type, pattern, callback, options, client,
#                  connection):
#     def send_destroy(self):
#     def destroy(self):
#     def accept(self, name):
#     def reject(self, name):
#     def _create_callback_response(self, message):
#     def _on_message(self, message):
#     def _send_listen(self):
#     def _on_ack_timeout(self):
#     def destroy_pending(self):
#     def send_future(self):
#     def __init__(self, client, resubscribe):
#     def destroy(self):
#     def _handle_connection_state_changes(self, state):
#     def __init__(self, client, topic, timeout_duration):
#     def add(self, name, action=None):
#     def remove(self, name, action=None):
#     def clear(self, message):
#     def _on_timeout(self, unique_name, name):
# def _pad_list(l, index, value):
#     def __repr__(self):
# def itoa(num, radix):
# def get_uid():


import re
from copy import deepcopy
from deepstreampy.utils import Undefined, num_types
    for token in tokens:
        try:
            node = node[token]
        except (IndexError, KeyError):
            return None

    if deep_copy:
        return deepcopy(node)
    else:
        return node


def set(data, path, value, deep_copy):
    if deep_copy:
        data = deepcopy(data)

    node = data

    tokens = _tokenize(path)
    if not tokens:
        data = value
        return data

    for i, token in enumerate(tokens[:-1]):
        try:
            node = node[token]
        except (KeyError, IndexError):
            if (i + 1 < len(tokens) and
                    isinstance(tokens[i+1], int)):
                if isinstance(node, list):

# Path: deepstreampy/utils.py
# class SingleNotifier(object):
# class Listener(object):
# class ResubscribeNotifier(object):
# class AckTimeoutRegistry(EventEmitter):
# class Undefined(object):
#     def __init__(self, client, connection, topic, action, timeout_duration):
#     def has_request(self, name):
#     def request(self, name, callback):
#     def receive(self, name, error, data):
#     def _on_response_timeout(self, name):
#     def _resend_requests(self):
#     def __init__(self, listener_type, pattern, callback, options, client,
#                  connection):
#     def send_destroy(self):
#     def destroy(self):
#     def accept(self, name):
#     def reject(self, name):
#     def _create_callback_response(self, message):
#     def _on_message(self, message):
#     def _send_listen(self):
#     def _on_ack_timeout(self):
#     def destroy_pending(self):
#     def send_future(self):
#     def __init__(self, client, resubscribe):
#     def destroy(self):
#     def _handle_connection_state_changes(self, state):
#     def __init__(self, client, topic, timeout_duration):
#     def add(self, name, action=None):
#     def remove(self, name, action=None):
#     def clear(self, message):
#     def _on_timeout(self, unique_name, name):
# def _pad_list(l, index, value):
#     def __repr__(self):
# def itoa(num, radix):
# def get_uid():


# Path: deepstreampy/jsonpath.py
import re
from copy import deepcopy
from deepstreampy.utils import Undefined, num_types

    for token in tokens:
        try:
            node = node[token]
        except (IndexError, KeyError):
            return None

    if deep_copy:
        return deepcopy(node)
    else:
        return node


def set(data, path, value, deep_copy):
    if deep_copy:
        data = deepcopy(data)

    node = data

    tokens = _tokenize(path)
    if not tokens:
        data = value
        return data

    for i, token in enumerate(tokens[:-1]):
        try:
            node = node[token]
        except (KeyError, IndexError):
            if (i + 1 < len(tokens) and
                    isinstance(tokens[i+1], int)):
                if isinstance(node, list):

                    _pad_list(node, token + 1, None)