# Path: google/cloud/ndb/_eventloop.py
# class EventLoop(object):
#     def __init__(self):
#     def clear(self):
#     def insort_event_right(self, event):
#     def call_soon(self, callback, *args, **kwargs):
#     def queue_call(self, delay, callback, *args, **kwargs):
#     def queue_rpc(self, rpc, callback):
#         def rpc_callback(rpc):
#     def add_idle(self, callback, *args, **kwargs):
#     def run_idle(self):
#     def _run_current(self):
#     def run0(self):
#     def run1(self):
#     def run(self):
# def get_event_loop():
# def add_idle(callback, *args, **kwargs):
# def call_soon(callback, *args, **kwargs):
# def queue_call(delay, callback, *args, **kwargs):
# def queue_rpc(future, rpc):
# def run():
# def run1():
# 
# Path: google/cloud/ndb/exceptions.py
# class Error(Exception):
# class ContextError(Error):
# class BadValueError(Error):
# class BadArgumentError(Error):
# class BadRequestError(Error):
# class Rollback(Error):
# class BadQueryError(Error):
# class BadFilterError(Error):
# class NoLongerImplementedError(NotImplementedError):
# class Cancelled(Error):
# class NestedRetryException(Error):
#     def __init__(self):
#     def __init__(self, filter):
#     def __init__(self):
# 
# Path: google/cloud/ndb/_remote.py
# class RemoteCall(object):
#     def __init__(self, future, info):
#         def record_time(future):
#     def __repr__(self):
#     def exception(self):
#     def result(self):
#     def add_done_callback(self, callback):
#         def wrapper(rpc):
#     def cancel(self):


import functools
import types
from google.cloud.ndb import _eventloop
from google.cloud.ndb import exceptions
from google.cloud.ndb import _remote
        from google.cloud.ndb import context as context_module
        from google.cloud.ndb import context as context_module
    from google.cloud.ndb import context as context_module
        self._result = None
        self._callbacks = []
        self._exception = None

    def __repr__(self):
        return "{}({!r}) <{}>".format(type(self).__name__, self.info, id(self))

    def done(self):
        """Get whether future has finished its task.

        Returns:
            bool: True if task has finished, False otherwise.
        """
        return self._done

    def running(self):
        """Get whether future's task is still running.

        Returns:
            bool: False if task has finished, True otherwise.
        """
        return not self._done

    def wait(self):
        """Wait for this future's task to complete.

        This future will be done and will have either a result or an exception
        after a call to this method.
        """
        while not self._done:

# Path: google/cloud/ndb/_eventloop.py
# class EventLoop(object):
#     def __init__(self):
#     def clear(self):
#     def insort_event_right(self, event):
#     def call_soon(self, callback, *args, **kwargs):
#     def queue_call(self, delay, callback, *args, **kwargs):
#     def queue_rpc(self, rpc, callback):
#         def rpc_callback(rpc):
#     def add_idle(self, callback, *args, **kwargs):
#     def run_idle(self):
#     def _run_current(self):
#     def run0(self):
#     def run1(self):
#     def run(self):
# def get_event_loop():
# def add_idle(callback, *args, **kwargs):
# def call_soon(callback, *args, **kwargs):
# def queue_call(delay, callback, *args, **kwargs):
# def queue_rpc(future, rpc):
# def run():
# def run1():
# 
# Path: google/cloud/ndb/exceptions.py
# class Error(Exception):
# class ContextError(Error):
# class BadValueError(Error):
# class BadArgumentError(Error):
# class BadRequestError(Error):
# class Rollback(Error):
# class BadQueryError(Error):
# class BadFilterError(Error):
# class NoLongerImplementedError(NotImplementedError):
# class Cancelled(Error):
# class NestedRetryException(Error):
#     def __init__(self):
#     def __init__(self, filter):
#     def __init__(self):
# 
# Path: google/cloud/ndb/_remote.py
# class RemoteCall(object):
#     def __init__(self, future, info):
#         def record_time(future):
#     def __repr__(self):
#     def exception(self):
#     def result(self):
#     def add_done_callback(self, callback):
#         def wrapper(rpc):
#     def cancel(self):


# Path: google/cloud/ndb/tasklets.py
import functools
import types
from google.cloud.ndb import _eventloop
from google.cloud.ndb import exceptions
from google.cloud.ndb import _remote
        from google.cloud.ndb import context as context_module
        from google.cloud.ndb import context as context_module
    from google.cloud.ndb import context as context_module

        self._result = None
        self._callbacks = []
        self._exception = None

    def __repr__(self):
        return "{}({!r}) <{}>".format(type(self).__name__, self.info, id(self))

    def done(self):
        """Get whether future has finished its task.

        Returns:
            bool: True if task has finished, False otherwise.
        """
        return self._done

    def running(self):
        """Get whether future's task is still running.

        Returns:
            bool: False if task has finished, True otherwise.
        """
        return not self._done

    def wait(self):
        """Wait for this future's task to complete.

        This future will be done and will have either a result or an exception
        after a call to this method.
        """
        while not self._done:

            if not _eventloop.run1():