# Path: snoop/utils.py
# PY34 = sys.version_info[:2] == (3, 4)
# NO_ASTTOKENS = PY34
# PYPY = 'pypy' in sys.version.lower()
# NO_BIRDSEYE = NO_ASTTOKENS or PYPY
# REPR_TARGET_LENGTH = 100
# def shitcode(s):
# def truncate(seq, max_length, middle):
# def truncate_string(string, max_length):
# def truncate_list(lst, max_length):
# def ensure_tuple(x, split=False):
# def short_filename(code):
# def is_comprehension_frame(frame):
# def needs_parentheses(source):
#     def code(s):
# def with_needed_parentheses(source):
# def my_cheap_repr(x):
#     def __init__(self, factory):
#     def __missing__(self, key):
# def optional_numeric_label(i, lst):
# def is_pathlike(x):
#     def iscoroutinefunction(_):
# def no_args_decorator(args, kwargs):
#     def __repr__(self):
# def _register_cheap_reprs():
#     def _sample_indices(length, max_length):
#     def _repr_series_one_line(x, helper):
# class ArgDefaultDict(dict):
#     class FormattedValue(object):
# class DirectRepr(str):
#     class QuerySet(object):


import ast
import opcode
import threading
import traceback
import executing
import six
from collections import defaultdict
from datetime import datetime
from textwrap import dedent
from pygments import highlight
from pygments.formatters.terminal256 import Terminal256Formatter
from pygments.lexers.python import Python3Lexer
from pygments.styles.monokai import MonokaiStyle
from six import PY3
from snoop.utils import ensure_tuple, short_filename, my_cheap_repr, \
    NO_ASTTOKENS, optional_numeric_label, try_statement, FormattedValue, ArgDefaultDict, lru_cache
    from pygments.lexers.python import Python2Lexer
    from pygments.lexers.python import PythonLexer as Python2Lexer
        arg = event.arg
        if arg is None:
            if opname == 'END_FINALLY':
                if event.frame_info.had_exception:
                    return [u'{c.red}??? Call either returned None or ended by exception{c.reset}'
                                .format(c=self.c)]
            elif opname not in ('RETURN_VALUE', 'YIELD_VALUE'):
                return [u'{c.red}!!! Call ended by exception{c.reset}'.format(c=self.c)]

        value = self.highlighted(my_cheap_repr(arg))
        if event.comprehension_type:
            prefix = plain_prefix = u'Result: '
        else:
            plain_prefix = u'<<< {description} value from {func}: '.format(
                description='Yield' if opname == 'YIELD_VALUE' else 'Return',
                func=event.code_qualname(),
            )
            prefix = u'{c.green}{}{c.reset}'.format(
                plain_prefix,
                c=self.c,
            )
        return indented_lines(prefix, value, plain_prefix=plain_prefix)

    def get_statement_start_lines(self, event, this_statement, last_statement):
        result = []
        if (
                event.event != 'call' and
                this_statement and last_statement and
                this_statement != last_statement and
                this_statement.lineno != event.line_no and

# Path: snoop/utils.py
# PY34 = sys.version_info[:2] == (3, 4)
# NO_ASTTOKENS = PY34
# PYPY = 'pypy' in sys.version.lower()
# NO_BIRDSEYE = NO_ASTTOKENS or PYPY
# REPR_TARGET_LENGTH = 100
# def shitcode(s):
# def truncate(seq, max_length, middle):
# def truncate_string(string, max_length):
# def truncate_list(lst, max_length):
# def ensure_tuple(x, split=False):
# def short_filename(code):
# def is_comprehension_frame(frame):
# def needs_parentheses(source):
#     def code(s):
# def with_needed_parentheses(source):
# def my_cheap_repr(x):
#     def __init__(self, factory):
#     def __missing__(self, key):
# def optional_numeric_label(i, lst):
# def is_pathlike(x):
#     def iscoroutinefunction(_):
# def no_args_decorator(args, kwargs):
#     def __repr__(self):
# def _register_cheap_reprs():
#     def _sample_indices(length, max_length):
#     def _repr_series_one_line(x, helper):
# class ArgDefaultDict(dict):
#     class FormattedValue(object):
# class DirectRepr(str):
#     class QuerySet(object):


# Path: snoop/formatting.py
import ast
import opcode
import threading
import traceback
import executing
import six
from collections import defaultdict
from datetime import datetime
from textwrap import dedent
from pygments import highlight
from pygments.formatters.terminal256 import Terminal256Formatter
from pygments.lexers.python import Python3Lexer
from pygments.styles.monokai import MonokaiStyle
from six import PY3
from snoop.utils import ensure_tuple, short_filename, my_cheap_repr, \
    NO_ASTTOKENS, optional_numeric_label, try_statement, FormattedValue, ArgDefaultDict, lru_cache
    from pygments.lexers.python import Python2Lexer
    from pygments.lexers.python import PythonLexer as Python2Lexer

        arg = event.arg
        if arg is None:
            if opname == 'END_FINALLY':
                if event.frame_info.had_exception:
                    return [u'{c.red}??? Call either returned None or ended by exception{c.reset}'
                                .format(c=self.c)]
            elif opname not in ('RETURN_VALUE', 'YIELD_VALUE'):
                return [u'{c.red}!!! Call ended by exception{c.reset}'.format(c=self.c)]

        value = self.highlighted(my_cheap_repr(arg))
        if event.comprehension_type:
            prefix = plain_prefix = u'Result: '
        else:
            plain_prefix = u'<<< {description} value from {func}: '.format(
                description='Yield' if opname == 'YIELD_VALUE' else 'Return',
                func=event.code_qualname(),
            )
            prefix = u'{c.green}{}{c.reset}'.format(
                plain_prefix,
                c=self.c,
            )
        return indented_lines(prefix, value, plain_prefix=plain_prefix)

    def get_statement_start_lines(self, event, this_statement, last_statement):
        result = []
        if (
                event.event != 'call' and
                this_statement and last_statement and
                this_statement != last_statement and
                this_statement.lineno != event.line_no and

                not isinstance(this_statement, try_statement)