# Path: nuka/utils.py
# PY3 = sys.version_info[0] == 3
# ARCHIVE_EXTS = ('.gz', '.tar', '.zip')
# LOG = 60
# CHANGED = logging.WARNING + 1
# PROGRESS = logging.WARNING + 2
#     def next(o):
# def default_watcher(delay=5):
#     def watcher(task, process):
# def import_module(name):
# def makedirs(dirname, mod=None, own=None):
# def chmod(dst, mod, recursive=False):
# def chown(dst, own, recursive=False):
# def best_executable():
# def isexecutable(path):
#     def __init__(self, value, alphabet=None, length=16):
#     def iterator(self):
#     def next(self):
# def proto_dumps(data, content_type=u'plain'):
# def proto_dumps_std(data, std, content_type='plain'):
# def proto_dumps_std_threadsafe(data, std):
# def proto_loads_std(std):
# class secret(object):
# 
# Path: nuka/task.py
# class teardown(SetupTask):
#     """remove `remote_dir` from the host"""
# 
#     teardown_cmd = '{0}rm -Rf {1[remote_dir]}'
# 
#     def __init__(self, host):
#         host._cancelled = False
#         super().__init__(host=host)
# 
#     def __class_name__(self):
#         return 'teardown'
# 
#     async def run(self):
#         if not self.host.failed():
#             sudo = self.host.use_sudo and 'sudo ' or ''
#             cmd = self.teardown_cmd.format(sudo, config)
#             await self.host.run_command(cmd, task=self)


import os
import sys
import jinja2
import nuka
from uuid import uuid4
from operator import itemgetter
from collections import defaultdict
from nuka.utils import json
from nuka.task import teardown
    from wsgiref.simple_server import make_server
                    cmd = 'nuka/script.py'
                name = 'subprocess({0})'.format(cmd)
            func = Item(
                name=name,
                type=item['type'],
                start=(item['start'] - _start),
                time=item['time'],
                parent=t.uid,
                latency=item.get('latency'),
                remote_calls=[],
            )
            if 'meta' in item:
                sh_start = func['start'] + item['latency']
                shs = item['meta']['remote_calls']
                for sh in shs:
                    tsh = Item(
                        type="sh",
                        start=sh_start,
                        name='sh({0})'.format(sh['cmd']),
                        time=sh['time'],
                        parent=t.uid,
                        rc=sh['rc'],
                    )
                    func['remote_calls'].append(round_dict(tsh))
                    sh_start += tsh.time
            t['funcs'].append(round_dict(func))

    _end = all_tasks[-1]
    _real_end = _end
    i = 1

# Path: nuka/utils.py
# PY3 = sys.version_info[0] == 3
# ARCHIVE_EXTS = ('.gz', '.tar', '.zip')
# LOG = 60
# CHANGED = logging.WARNING + 1
# PROGRESS = logging.WARNING + 2
#     def next(o):
# def default_watcher(delay=5):
#     def watcher(task, process):
# def import_module(name):
# def makedirs(dirname, mod=None, own=None):
# def chmod(dst, mod, recursive=False):
# def chown(dst, own, recursive=False):
# def best_executable():
# def isexecutable(path):
#     def __init__(self, value, alphabet=None, length=16):
#     def iterator(self):
#     def next(self):
# def proto_dumps(data, content_type=u'plain'):
# def proto_dumps_std(data, std, content_type='plain'):
# def proto_dumps_std_threadsafe(data, std):
# def proto_loads_std(std):
# class secret(object):
# 
# Path: nuka/task.py
# class teardown(SetupTask):
#     """remove `remote_dir` from the host"""
# 
#     teardown_cmd = '{0}rm -Rf {1[remote_dir]}'
# 
#     def __init__(self, host):
#         host._cancelled = False
#         super().__init__(host=host)
# 
#     def __class_name__(self):
#         return 'teardown'
# 
#     async def run(self):
#         if not self.host.failed():
#             sudo = self.host.use_sudo and 'sudo ' or ''
#             cmd = self.teardown_cmd.format(sudo, config)
#             await self.host.run_command(cmd, task=self)


# Path: nuka/reports.py
import os
import sys
import jinja2
import nuka
from uuid import uuid4
from operator import itemgetter
from collections import defaultdict
from nuka.utils import json
from nuka.task import teardown
    from wsgiref.simple_server import make_server

                    cmd = 'nuka/script.py'
                name = 'subprocess({0})'.format(cmd)
            func = Item(
                name=name,
                type=item['type'],
                start=(item['start'] - _start),
                time=item['time'],
                parent=t.uid,
                latency=item.get('latency'),
                remote_calls=[],
            )
            if 'meta' in item:
                sh_start = func['start'] + item['latency']
                shs = item['meta']['remote_calls']
                for sh in shs:
                    tsh = Item(
                        type="sh",
                        start=sh_start,
                        name='sh({0})'.format(sh['cmd']),
                        time=sh['time'],
                        parent=t.uid,
                        rc=sh['rc'],
                    )
                    func['remote_calls'].append(round_dict(tsh))
                    sh_start += tsh.time
            t['funcs'].append(round_dict(func))

    _end = all_tasks[-1]
    _real_end = _end
    i = 1

    while isinstance(_real_end['task'], teardown):