# 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
            dot.node(node_id, label)
            return node_id

        def _create_sub_graph(root):
            rid = _create_node(root["info"])
            for child in root["children"]:
                cid = _create_sub_graph(child)
                dot.edge(rid, cid)
            return rid

        _create_sub_graph(trace)
        return dot

    @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("--error-trace", dest="error_trace",
                  type=bool, default=False,
                  help="List all traces that contain error.")
    def list(self, args):
        """List all traces"""
        if not args.conn_str:
            raise exc.CommandError(
                "You must provide connection string via"
                " either --connection-string or "
                "via env[OSPROFILER_CONNECTION_STRING]")
        try:
            engine = base.get_driver(args.conn_str, **args.__dict__)
        except Exception as e:

# 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

            dot.node(node_id, label)
            return node_id

        def _create_sub_graph(root):
            rid = _create_node(root["info"])
            for child in root["children"]:
                cid = _create_sub_graph(child)
                dot.edge(rid, cid)
            return rid

        _create_sub_graph(trace)
        return dot

    @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("--error-trace", dest="error_trace",
                  type=bool, default=False,
                  help="List all traces that contain error.")
    def list(self, args):
        """List all traces"""
        if not args.conn_str:
            raise exc.CommandError(
                "You must provide connection string via"
                " either --connection-string or "
                "via env[OSPROFILER_CONNECTION_STRING]")
        try:
            engine = base.get_driver(args.conn_str, **args.__dict__)
        except Exception as e:

            raise exc.CommandError(e.message)