# Path: nuka/log.py
# class HostLogger(logging.Logger):
# class HostFileHandler(logging.FileHandler):
# class HostStreamHandler(logging.StreamHandler):
#     def __init__(self, host):
#     def changed(self, *args, **kwargs):
#     def __call__(self, msg, *args, **kwargs):
#     def _extra_logs(self, level, i, *args, **kwargs):
#     def debug2(self, *args, **kwargs):
#     def debug3(self, *args, **kwargs):
#     def debug4(self, *args, **kwargs):
#     def debug5(self, *args, **kwargs):
#     def exception5(self, *args, **kwargs):
#     def __init__(self, host, level, filename=None):
#     def rollover(self):
#     def __init__(self, host, level):
#     def format(self, record):
# 
# Path: nuka/process.py
# DEFAULT_LIMIT = streams._DEFAULT_LIMIT
# class BaseProcess:
# class Process(subprocess.Process, BaseProcess):
# class SSHClient(asyncssh.SSHClient):
# class SSHClientProcess(asyncssh.SSHClientProcess, BaseProcess):
#     async def send_message(self, message, drain=True):
#     async def next_message(self):
#     async def exit(self):
#     def __init__(self, transport, protocol, host, task, cmd, start):
#     def __init__(self, uid):
#     def connection_made(self, *args, **kwargs):
#     def auth_completed(self, *args, **kwargs):
#     def __init__(self, host, task, cmd, start):
#     def returncode(self):
# async def get_keys(loop):
# def get_known_hosts(filename):
# async def delay_connection(uid, loop):
# async def create(cmd, host, task=None):
#         def protocol_factory():
#         def protocol_factory():
# def close_connections():
# def close_awaiting_tasks():
# 
# Path: nuka/task.py
# async def wait_for_boot(host):
#     if not host.fully_booted.done():
#         create_setup_tasks(host)
#         task = host._named_tasks[setup.__name__]
#         if not task.done():
#             await task
# 
# Path: nuka/task.py
# def get_task_from_stack():
#     for info in inspect.stack(3):
#         f = info.frame
#         self = f.f_locals.get('self')
#         if isinstance(f.f_locals.get('self'), Base):
#             return self
# 
# Path: nuka/task.py
# class destroy(SetupTask):
#     """destroy the host"""
# 
#     def __init__(self, host):
#         host._cancelled = False
#         super().__init__(host=host)
# 
#     def __class_name__(self):
#         return 'destroy'
# 
#     async def run(self):
#         if 'destroyed' not in self.host.vars:
#             await self.host.destroy()


import os
import sys
import time
import asyncio
import resource
import nuka
from operator import itemgetter
from collections import deque
from collections import OrderedDict
from nuka import log
from nuka import process
from nuka.task import wait_for_boot
from nuka.task import get_task_from_stack
from nuka.task import destroy as destroy_task

    @property
    def private_ip(self):
        """return host's private ip"""
        return self._get_best_addresses(public=False)

    def __getattr__(self, attr):
        return self.vars[attr]

    def __str__(self):
        return self.name

    def __repr__(self):
        s = '<{0} {1}'.format(self.__class__.__name__, self.name)
        if self.cancelled():
            s += ' cancelled'
        s += '>'
        return s

    @property
    def bootstrap_command(self):
        return self.vars.get('bootstrap_command')

    async def boot(self):  # pragma: no cover
        """boot the host"""
        return dict(rc=0)

    async def get_inventory(self):  # pragma: no cover
        """return host's inventory. await for host's boot & setup if needed"""
        if not self.fully_booted.done():

# Path: nuka/log.py
# class HostLogger(logging.Logger):
# class HostFileHandler(logging.FileHandler):
# class HostStreamHandler(logging.StreamHandler):
#     def __init__(self, host):
#     def changed(self, *args, **kwargs):
#     def __call__(self, msg, *args, **kwargs):
#     def _extra_logs(self, level, i, *args, **kwargs):
#     def debug2(self, *args, **kwargs):
#     def debug3(self, *args, **kwargs):
#     def debug4(self, *args, **kwargs):
#     def debug5(self, *args, **kwargs):
#     def exception5(self, *args, **kwargs):
#     def __init__(self, host, level, filename=None):
#     def rollover(self):
#     def __init__(self, host, level):
#     def format(self, record):
# 
# Path: nuka/process.py
# DEFAULT_LIMIT = streams._DEFAULT_LIMIT
# class BaseProcess:
# class Process(subprocess.Process, BaseProcess):
# class SSHClient(asyncssh.SSHClient):
# class SSHClientProcess(asyncssh.SSHClientProcess, BaseProcess):
#     async def send_message(self, message, drain=True):
#     async def next_message(self):
#     async def exit(self):
#     def __init__(self, transport, protocol, host, task, cmd, start):
#     def __init__(self, uid):
#     def connection_made(self, *args, **kwargs):
#     def auth_completed(self, *args, **kwargs):
#     def __init__(self, host, task, cmd, start):
#     def returncode(self):
# async def get_keys(loop):
# def get_known_hosts(filename):
# async def delay_connection(uid, loop):
# async def create(cmd, host, task=None):
#         def protocol_factory():
#         def protocol_factory():
# def close_connections():
# def close_awaiting_tasks():
# 
# Path: nuka/task.py
# async def wait_for_boot(host):
#     if not host.fully_booted.done():
#         create_setup_tasks(host)
#         task = host._named_tasks[setup.__name__]
#         if not task.done():
#             await task
# 
# Path: nuka/task.py
# def get_task_from_stack():
#     for info in inspect.stack(3):
#         f = info.frame
#         self = f.f_locals.get('self')
#         if isinstance(f.f_locals.get('self'), Base):
#             return self
# 
# Path: nuka/task.py
# class destroy(SetupTask):
#     """destroy the host"""
# 
#     def __init__(self, host):
#         host._cancelled = False
#         super().__init__(host=host)
# 
#     def __class_name__(self):
#         return 'destroy'
# 
#     async def run(self):
#         if 'destroyed' not in self.host.vars:
#             await self.host.destroy()


# Path: nuka/hosts/base.py
import os
import sys
import time
import asyncio
import resource
import nuka
from operator import itemgetter
from collections import deque
from collections import OrderedDict
from nuka import log
from nuka import process
from nuka.task import wait_for_boot
from nuka.task import get_task_from_stack
from nuka.task import destroy as destroy_task


    @property
    def private_ip(self):
        """return host's private ip"""
        return self._get_best_addresses(public=False)

    def __getattr__(self, attr):
        return self.vars[attr]

    def __str__(self):
        return self.name

    def __repr__(self):
        s = '<{0} {1}'.format(self.__class__.__name__, self.name)
        if self.cancelled():
            s += ' cancelled'
        s += '>'
        return s

    @property
    def bootstrap_command(self):
        return self.vars.get('bootstrap_command')

    async def boot(self):  # pragma: no cover
        """boot the host"""
        return dict(rc=0)

    async def get_inventory(self):  # pragma: no cover
        """return host's inventory. await for host's boot & setup if needed"""
        if not self.fully_booted.done():

            await wait_for_boot(self)