# Path: osprofiler/cmd/commands.py
# class BaseCommand(object):
# class TraceCommands(BaseCommand):
#     def show(self, args):
#         def datetime_json_serialize(obj):
#     def _create_dot_graph(self, trace):
#         def _create_node(info):
#         def _create_sub_graph(root):
#     def list(self, args):
# 
# Path: osprofiler/exc.py
# class CommandError(Exception):
# class LogInsightAPIError(Exception):
# class LogInsightLoginTimeout(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
# 
# Path: osprofiler/opts.py
# _PROFILER_OPTS = [
#     _enabled_opt,
#     _trace_sqlalchemy_opt,
#     _hmac_keys_opt,
#     _connection_string_opt,
#     _es_doc_type_opt,
#     _es_scroll_time_opt,
#     _es_scroll_size_opt,
#     _socket_timeout_opt,
#     _sentinel_service_name_opt,
#     _filter_error_trace
# ]
# def set_defaults(conf, enabled=None, trace_sqlalchemy=None, hmac_keys=None,
#                  connection_string=None, es_doc_type=None,
#                  es_scroll_time=None, es_scroll_size=None,
#                  socket_timeout=None, sentinel_service_name=None):
# def is_trace_enabled(conf=None):
# def is_db_trace_enabled(conf=None):
# def enable_web_trace(conf=None):
# def disable_web_trace(conf=None):
# def list_opts():


import argparse
import inspect
import sys
import osprofiler
from oslo_config import cfg
from osprofiler.cmd import commands
from osprofiler import exc
from osprofiler import opts





class OSProfilerShell(object):

    def __init__(self, argv):
        args = self._get_base_parser().parse_args(argv)
        opts.set_defaults(cfg.CONF)

        args.func(args)

    def _get_base_parser(self):
        parser = argparse.ArgumentParser(
            prog="osprofiler",
            description=__doc__.strip(),
            add_help=True
        )

        parser.add_argument("-v", "--version",
                            action="version",
                            version=osprofiler.__version__)

        self._append_subcommands(parser)

        return parser

    def _append_subcommands(self, parent_parser):
        subcommands = parent_parser.add_subparsers(help="<subcommands>")

# Path: osprofiler/cmd/commands.py
# class BaseCommand(object):
# class TraceCommands(BaseCommand):
#     def show(self, args):
#         def datetime_json_serialize(obj):
#     def _create_dot_graph(self, trace):
#         def _create_node(info):
#         def _create_sub_graph(root):
#     def list(self, args):
# 
# Path: osprofiler/exc.py
# class CommandError(Exception):
# class LogInsightAPIError(Exception):
# class LogInsightLoginTimeout(Exception):
#     def __init__(self, message=None):
#     def __str__(self):
# 
# Path: osprofiler/opts.py
# _PROFILER_OPTS = [
#     _enabled_opt,
#     _trace_sqlalchemy_opt,
#     _hmac_keys_opt,
#     _connection_string_opt,
#     _es_doc_type_opt,
#     _es_scroll_time_opt,
#     _es_scroll_size_opt,
#     _socket_timeout_opt,
#     _sentinel_service_name_opt,
#     _filter_error_trace
# ]
# def set_defaults(conf, enabled=None, trace_sqlalchemy=None, hmac_keys=None,
#                  connection_string=None, es_doc_type=None,
#                  es_scroll_time=None, es_scroll_size=None,
#                  socket_timeout=None, sentinel_service_name=None):
# def is_trace_enabled(conf=None):
# def is_db_trace_enabled(conf=None):
# def enable_web_trace(conf=None):
# def disable_web_trace(conf=None):
# def list_opts():


# Path: osprofiler/cmd/shell.py
import argparse
import inspect
import sys
import osprofiler
from oslo_config import cfg
from osprofiler.cmd import commands
from osprofiler import exc
from osprofiler import opts






class OSProfilerShell(object):

    def __init__(self, argv):
        args = self._get_base_parser().parse_args(argv)
        opts.set_defaults(cfg.CONF)

        args.func(args)

    def _get_base_parser(self):
        parser = argparse.ArgumentParser(
            prog="osprofiler",
            description=__doc__.strip(),
            add_help=True
        )

        parser.add_argument("-v", "--version",
                            action="version",
                            version=osprofiler.__version__)

        self._append_subcommands(parser)

        return parser

    def _append_subcommands(self, parent_parser):
        subcommands = parent_parser.add_subparsers(help="<subcommands>")

        for group_cls in commands.BaseCommand.__subclasses__():