# Path: osprofiler/cmd/cliutils.py
# def env(*args, **kwargs):
# def arg(*args, **kwargs):
#     def _decorator(func):
# def add_arg(func, *args, **kwargs):
# 
# Path: osprofiler/drivers/base.py
# LOG = logging.getLogger(__name__)
# def get_driver(connection_string, *args, **kwargs):
#     def __init__(self, connection_str, project=None, service=None, host=None,
#                  **kwargs):
#     def notify(self, info, **kwargs):
#     def get_report(self, base_id):
#     def get_name(cls):
#     def list_traces(self, fields=None):
#     def list_error_traces(self):
#     def _build_tree(nodes):
#     def _append_results(self, trace_id, parent_id, name, project, service,
#                         host, timestamp, raw_payload=None):
#     def _parse_results(self):
#         def msec(dt):
# class Driver(object):
# 
# Path: osprofiler/exc.py
# class CommandError(Exception):
# class LogInsightAPIError(Exception):
# class LogInsightLoginTimeout(Exception):
#     def __init__(self, message=None):
#     def __str__(self):


import json
import os
import prettytable
            import graphviz
from oslo_utils import encodeutils
from oslo_utils import uuidutils
from osprofiler.cmd import cliutils
from osprofiler.drivers import base
from osprofiler import exc

class BaseCommand(object):
    group_name = None


class TraceCommands(BaseCommand):
    group_name = "trace"

    @cliutils.arg("trace", help="File with trace or trace id")
    @cliutils.arg("--connection-string", dest="conn_str",
                  default=(cliutils.env("OSPROFILER_CONNECTION_STRING")),
                  help="Storage driver's connection string. Defaults to "
                       "env[OSPROFILER_CONNECTION_STRING] if set")
    @cliutils.arg("--transport-url", dest="transport_url",
                  help="Oslo.messaging transport URL (for messaging:// driver "
                       "only), e.g. rabbit://user:password@host:5672/")
    @cliutils.arg("--idle-timeout", dest="idle_timeout", type=int, default=1,
                  help="How long to wait for the trace to finish, in seconds "
                       "(for messaging:// driver only)")
    @cliutils.arg("--json", dest="use_json", action="store_true",
                  help="show trace in JSON")
    @cliutils.arg("--html", dest="use_html", action="store_true",
                  help="show trace in HTML")
    @cliutils.arg("--local-libs", dest="local_libs", action="store_true",
                  help="use local static files of html in /libs/")
    @cliutils.arg("--dot", dest="use_dot", action="store_true",
                  help="show trace in DOT language")
    @cliutils.arg("--render-dot", dest="render_dot_filename",
                  help="filename for rendering the dot graph in pdf format")
    @cliutils.arg("--out", dest="file_name", help="save output in file")

# Path: osprofiler/cmd/cliutils.py
# def env(*args, **kwargs):
# def arg(*args, **kwargs):
#     def _decorator(func):
# def add_arg(func, *args, **kwargs):
# 
# Path: osprofiler/drivers/base.py
# LOG = logging.getLogger(__name__)
# def get_driver(connection_string, *args, **kwargs):
#     def __init__(self, connection_str, project=None, service=None, host=None,
#                  **kwargs):
#     def notify(self, info, **kwargs):
#     def get_report(self, base_id):
#     def get_name(cls):
#     def list_traces(self, fields=None):
#     def list_error_traces(self):
#     def _build_tree(nodes):
#     def _append_results(self, trace_id, parent_id, name, project, service,
#                         host, timestamp, raw_payload=None):
#     def _parse_results(self):
#         def msec(dt):
# class Driver(object):
# 
# Path: osprofiler/exc.py
# class CommandError(Exception):
# class LogInsightAPIError(Exception):
# class LogInsightLoginTimeout(Exception):
#     def __init__(self, message=None):
#     def __str__(self):


# Path: osprofiler/cmd/commands.py
import json
import os
import prettytable
            import graphviz
from oslo_utils import encodeutils
from oslo_utils import uuidutils
from osprofiler.cmd import cliutils
from osprofiler.drivers import base
from osprofiler import exc


class BaseCommand(object):
    group_name = None


class TraceCommands(BaseCommand):
    group_name = "trace"

    @cliutils.arg("trace", help="File with trace or trace id")
    @cliutils.arg("--connection-string", dest="conn_str",
                  default=(cliutils.env("OSPROFILER_CONNECTION_STRING")),
                  help="Storage driver's connection string. Defaults to "
                       "env[OSPROFILER_CONNECTION_STRING] if set")
    @cliutils.arg("--transport-url", dest="transport_url",
                  help="Oslo.messaging transport URL (for messaging:// driver "
                       "only), e.g. rabbit://user:password@host:5672/")
    @cliutils.arg("--idle-timeout", dest="idle_timeout", type=int, default=1,
                  help="How long to wait for the trace to finish, in seconds "
                       "(for messaging:// driver only)")
    @cliutils.arg("--json", dest="use_json", action="store_true",
                  help="show trace in JSON")
    @cliutils.arg("--html", dest="use_html", action="store_true",
                  help="show trace in HTML")
    @cliutils.arg("--local-libs", dest="local_libs", action="store_true",
                  help="use local static files of html in /libs/")
    @cliutils.arg("--dot", dest="use_dot", action="store_true",
                  help="show trace in DOT language")
    @cliutils.arg("--render-dot", dest="render_dot_filename",
                  help="filename for rendering the dot graph in pdf format")
    @cliutils.arg("--out", dest="file_name", help="save output in file")

    def show(self, args):