# Path: oslo_utils/encodeutils.py
# def safe_decode(text, incoming=None, errors='strict'):
# def safe_encode(text, incoming=None,
#                 encoding='utf-8', errors='strict'):
# def to_utf8(text):
# def exception_to_unicode(exc):
# 
# Path: oslo_utils/reflection.py
#     _TYPE_TYPE = types.TypeType
#     _TYPE_TYPE = type
# _BUILTIN_MODULES = ('builtins', '__builtin__', '__builtins__', 'exceptions')
# LOG = logging.getLogger(__name__)
# def get_members(obj, exclude_hidden=True):
# def get_member_names(obj, exclude_hidden=True):
# def get_class_name(obj, fully_qualified=True, truncate_builtins=True):
# def get_all_class_names(obj, up_to=object,
#                         fully_qualified=True, truncate_builtins=True):
# def get_callable_name(function):
# def get_method_self(method):
# def is_same_callback(callback1, callback2, strict=True):
# def is_bound_method(method):
# def is_subclass(obj, cls):
# def get_callable_args(function, required_only=False):
# def accepts_kwargs(function):
# 
# Path: oslo_utils/timeutils.py
# _ISO8601_TIME_FORMAT_SUBSECOND = '%Y-%m-%dT%H:%M:%S.%f'
# _ISO8601_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S'
# PERFECT_TIME_FORMAT = _ISO8601_TIME_FORMAT_SUBSECOND
# _MAX_DATETIME_SEC = 59
#     _STARTED = 'STARTED'
#     _STOPPED = 'STOPPED'
# def isotime(at=None, subsecond=False):
# def parse_isotime(timestr):
# def strtime(at=None, fmt=PERFECT_TIME_FORMAT):
# def parse_strtime(timestr, fmt=PERFECT_TIME_FORMAT):
# def normalize_time(timestamp):
# def is_older_than(before, seconds):
# def is_newer_than(after, seconds):
# def utcnow_ts(microsecond=False):
# def utcnow(with_timezone=False):
# def iso8601_from_timestamp(timestamp, microsecond=False):
# def set_time_override(override_time=None):
# def advance_time_delta(timedelta):
# def advance_time_seconds(seconds):
# def clear_time_override():
# def marshall_now(now=None):
# def unmarshall_time(tyme):
# def delta_seconds(before, after):
# def is_soon(dt, window):
#     def __init__(self, elapsed, length):
#     def elapsed(self):
#     def length(self):
#     def __repr__(self):
# def time_it(logger, log_level=logging.DEBUG,
#             message="It took %(seconds).02f seconds to"
#                     " run function '%(func_name)s'",
#             enabled=True, min_duration=0.01):
#     def decorator(func):
#         def wrapper(*args, **kwargs):
#     def __init__(self, duration=None):
#     def start(self):
#     def splits(self):
#     def split(self):
#     def restart(self):
#     def _delta_seconds(earlier, later):
#     def elapsed(self, maximum=None):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
#     def leftover(self, return_none=False):
#     def expired(self):
#     def has_started(self):
#     def has_stopped(self):
#     def resume(self):
#     def stop(self):
# class Split(object):
# class StopWatch(object):


import functools
import io
import logging
import os
import sys
import time
import traceback
from oslo_utils import encodeutils
from oslo_utils import reflection
from oslo_utils import timeutils
    def __bytes__(self):
        return self.pformat().encode("utf8")

    def __str__(self):
        return self.pformat()

    def _get_message(self):
        # We must *not* call into the ``__str__`` method as that will
        # reactivate the pformat method, which will end up badly (and doesn't
        # look pretty at all); so be careful...
        return self.args[0]

    def pformat(self, indent=2, indent_text=" ", show_root_class=False):
        """Pretty formats a caused exception + any connected causes."""
        if indent < 0:
            raise ValueError("Provided 'indent' must be greater than"
                             " or equal to zero instead of %s" % indent)
        buf = io.StringIO()
        if show_root_class:
            buf.write(reflection.get_class_name(self, fully_qualified=False))
            buf.write(": ")
        buf.write(self._get_message())
        active_indent = indent
        next_up = self.cause
        seen = []
        while next_up is not None and next_up not in seen:
            seen.append(next_up)
            buf.write(os.linesep)
            if isinstance(next_up, CausedByException):
                buf.write(indent_text * active_indent)

# Path: oslo_utils/encodeutils.py
# def safe_decode(text, incoming=None, errors='strict'):
# def safe_encode(text, incoming=None,
#                 encoding='utf-8', errors='strict'):
# def to_utf8(text):
# def exception_to_unicode(exc):
# 
# Path: oslo_utils/reflection.py
#     _TYPE_TYPE = types.TypeType
#     _TYPE_TYPE = type
# _BUILTIN_MODULES = ('builtins', '__builtin__', '__builtins__', 'exceptions')
# LOG = logging.getLogger(__name__)
# def get_members(obj, exclude_hidden=True):
# def get_member_names(obj, exclude_hidden=True):
# def get_class_name(obj, fully_qualified=True, truncate_builtins=True):
# def get_all_class_names(obj, up_to=object,
#                         fully_qualified=True, truncate_builtins=True):
# def get_callable_name(function):
# def get_method_self(method):
# def is_same_callback(callback1, callback2, strict=True):
# def is_bound_method(method):
# def is_subclass(obj, cls):
# def get_callable_args(function, required_only=False):
# def accepts_kwargs(function):
# 
# Path: oslo_utils/timeutils.py
# _ISO8601_TIME_FORMAT_SUBSECOND = '%Y-%m-%dT%H:%M:%S.%f'
# _ISO8601_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S'
# PERFECT_TIME_FORMAT = _ISO8601_TIME_FORMAT_SUBSECOND
# _MAX_DATETIME_SEC = 59
#     _STARTED = 'STARTED'
#     _STOPPED = 'STOPPED'
# def isotime(at=None, subsecond=False):
# def parse_isotime(timestr):
# def strtime(at=None, fmt=PERFECT_TIME_FORMAT):
# def parse_strtime(timestr, fmt=PERFECT_TIME_FORMAT):
# def normalize_time(timestamp):
# def is_older_than(before, seconds):
# def is_newer_than(after, seconds):
# def utcnow_ts(microsecond=False):
# def utcnow(with_timezone=False):
# def iso8601_from_timestamp(timestamp, microsecond=False):
# def set_time_override(override_time=None):
# def advance_time_delta(timedelta):
# def advance_time_seconds(seconds):
# def clear_time_override():
# def marshall_now(now=None):
# def unmarshall_time(tyme):
# def delta_seconds(before, after):
# def is_soon(dt, window):
#     def __init__(self, elapsed, length):
#     def elapsed(self):
#     def length(self):
#     def __repr__(self):
# def time_it(logger, log_level=logging.DEBUG,
#             message="It took %(seconds).02f seconds to"
#                     " run function '%(func_name)s'",
#             enabled=True, min_duration=0.01):
#     def decorator(func):
#         def wrapper(*args, **kwargs):
#     def __init__(self, duration=None):
#     def start(self):
#     def splits(self):
#     def split(self):
#     def restart(self):
#     def _delta_seconds(earlier, later):
#     def elapsed(self, maximum=None):
#     def __enter__(self):
#     def __exit__(self, type, value, traceback):
#     def leftover(self, return_none=False):
#     def expired(self):
#     def has_started(self):
#     def has_stopped(self):
#     def resume(self):
#     def stop(self):
# class Split(object):
# class StopWatch(object):


# Path: oslo_utils/excutils.py
import functools
import io
import logging
import os
import sys
import time
import traceback
from oslo_utils import encodeutils
from oslo_utils import reflection
from oslo_utils import timeutils

    def __bytes__(self):
        return self.pformat().encode("utf8")

    def __str__(self):
        return self.pformat()

    def _get_message(self):
        # We must *not* call into the ``__str__`` method as that will
        # reactivate the pformat method, which will end up badly (and doesn't
        # look pretty at all); so be careful...
        return self.args[0]

    def pformat(self, indent=2, indent_text=" ", show_root_class=False):
        """Pretty formats a caused exception + any connected causes."""
        if indent < 0:
            raise ValueError("Provided 'indent' must be greater than"
                             " or equal to zero instead of %s" % indent)
        buf = io.StringIO()
        if show_root_class:
            buf.write(reflection.get_class_name(self, fully_qualified=False))
            buf.write(": ")
        buf.write(self._get_message())
        active_indent = indent
        next_up = self.cause
        seen = []
        while next_up is not None and next_up not in seen:
            seen.append(next_up)
            buf.write(os.linesep)
            if isinstance(next_up, CausedByException):
                buf.write(indent_text * active_indent)

                buf.write(reflection.get_class_name(next_up,