# Path: zoonado/exc.py
# class ZKError(Exception):
# class ConnectError(ZKError):
# class NoServersError(ZKError):
# class SessionLost(ZKError):
# class InvalidClientState(ZKError):
# class TimeoutError(ZKError):
# class FailedRetry(ZKError):
# class ResponseErrorMeta(type):
# class ResponseError(ZKError):
# class UnknownError(ResponseError):
# class RolledBack(ResponseError):
# class ZKSystemError(ResponseError):
# class RuntimeInconsistency(ResponseError):
# class DataInconsistency(ResponseError):
# class ConnectionLoss(ResponseError):
# class MarshallingError(ResponseError):
# class Unimplemented(ResponseError):
# class OperationTimeout(ResponseError):
# class BadArguments(ResponseError):
# class UnknownSession(ResponseError):
# class NewConfigNoQuorum(ResponseError):
# class ReconfigInProcess(ResponseError):
# class APIError(ResponseError):
# class NoNode(ResponseError):
# class NoAuth(ResponseError):
# class BadVersion(ResponseError):
# class NoChildrenForEphemerals(ResponseError):
# class NodeExists(ResponseError):
# class NotEmpty(ResponseError):
# class SessionExpired(ResponseError):
# class InvalidCallback(ResponseError):
# class InvalidACL(ResponseError):
# class AuthFailed(ResponseError):
# class SessionMoved(ResponseError):
# class NotReadOnly(ResponseError):
# class EphemeralOnLocalSession(ResponseError):
# class NoWatcher(ResponseError):
#     def __init__(self, host, port, server_id=None):
#     def __str__(self):
#     def __new__(cls, name, bases, attrs):
#     def __str__(self):
#     def __init__(self, error_code):
#     def __str__(self):
# def get_response_error(error_code):


from tornado import gen
from zoonado import exc
                recipe_class, recipe_args = recipe_class

            recipe_args = [getattr(self, arg) for arg in recipe_args]

            recipe = recipe_class(*recipe_args)

            setattr(self, attribute_name, recipe)

    def set_client(self, client):
        self.client = client
        for sub_recipe in self.sub_recipes.keys():
            getattr(self, sub_recipe).set_client(client)

    @classmethod
    def validate_dependencies(cls):
        return True

    @gen.coroutine
    def ensure_path(self):
        yield self.client.ensure_path(self.base_path)

    @gen.coroutine
    def create_znode(self, path):
        try:
            yield self.client.create(path)
        except exc.NodeExists:
            pass
        except exc.NoNode:
            try:
                yield self.ensure_path()

# Path: zoonado/exc.py
# class ZKError(Exception):
# class ConnectError(ZKError):
# class NoServersError(ZKError):
# class SessionLost(ZKError):
# class InvalidClientState(ZKError):
# class TimeoutError(ZKError):
# class FailedRetry(ZKError):
# class ResponseErrorMeta(type):
# class ResponseError(ZKError):
# class UnknownError(ResponseError):
# class RolledBack(ResponseError):
# class ZKSystemError(ResponseError):
# class RuntimeInconsistency(ResponseError):
# class DataInconsistency(ResponseError):
# class ConnectionLoss(ResponseError):
# class MarshallingError(ResponseError):
# class Unimplemented(ResponseError):
# class OperationTimeout(ResponseError):
# class BadArguments(ResponseError):
# class UnknownSession(ResponseError):
# class NewConfigNoQuorum(ResponseError):
# class ReconfigInProcess(ResponseError):
# class APIError(ResponseError):
# class NoNode(ResponseError):
# class NoAuth(ResponseError):
# class BadVersion(ResponseError):
# class NoChildrenForEphemerals(ResponseError):
# class NodeExists(ResponseError):
# class NotEmpty(ResponseError):
# class SessionExpired(ResponseError):
# class InvalidCallback(ResponseError):
# class InvalidACL(ResponseError):
# class AuthFailed(ResponseError):
# class SessionMoved(ResponseError):
# class NotReadOnly(ResponseError):
# class EphemeralOnLocalSession(ResponseError):
# class NoWatcher(ResponseError):
#     def __init__(self, host, port, server_id=None):
#     def __str__(self):
#     def __new__(cls, name, bases, attrs):
#     def __str__(self):
#     def __init__(self, error_code):
#     def __str__(self):
# def get_response_error(error_code):


# Path: zoonado/recipes/recipe.py
from tornado import gen
from zoonado import exc

                recipe_class, recipe_args = recipe_class

            recipe_args = [getattr(self, arg) for arg in recipe_args]

            recipe = recipe_class(*recipe_args)

            setattr(self, attribute_name, recipe)

    def set_client(self, client):
        self.client = client
        for sub_recipe in self.sub_recipes.keys():
            getattr(self, sub_recipe).set_client(client)

    @classmethod
    def validate_dependencies(cls):
        return True

    @gen.coroutine
    def ensure_path(self):
        yield self.client.ensure_path(self.base_path)

    @gen.coroutine
    def create_znode(self, path):
        try:
            yield self.client.create(path)
        except exc.NodeExists:
            pass
        except exc.NoNode:
            try:
                yield self.ensure_path()

            except exc.NodeExists: