# Path: snoop/utils.py
# def with_needed_parentheses(source):
#     if needs_parentheses(source):
#         return '({})'.format(source)
#     else:
#         return source
# 
# def my_cheap_repr(x):
#     return cheap_repr(x, target_length=REPR_TARGET_LENGTH)
# 
# def ensure_tuple(x, split=False):
#     if split and isinstance(x, six.string_types):
#         x = x.replace(',', ' ').split()
#     if not isinstance(x, (list, set, tuple)):
#         x = (x,)
#     return tuple(x)


import itertools
import six
from copy import deepcopy
from snoop.utils import with_needed_parentheses, my_cheap_repr, ensure_tuple
    from collections import Mapping, Sequence
    from collections.abc import Mapping, Sequence

    def _keys(self, main_value):
        return ()

    def _format_key(self, key):
        raise NotImplementedError

    def _get_value(self, main_value, key):
        raise NotImplementedError


class Attrs(CommonVariable):
    def _keys(self, main_value):
        return itertools.chain(
            getattr(main_value, '__dict__', ()),
            getattr(main_value, '__slots__', ())
        )

    def _format_key(self, key):
        return '.' + key

    def _get_value(self, main_value, key):
        return getattr(main_value, key)


class Keys(CommonVariable):
    def _keys(self, main_value):
        return main_value.keys()

    def _format_key(self, key):

# Path: snoop/utils.py
# def with_needed_parentheses(source):
#     if needs_parentheses(source):
#         return '({})'.format(source)
#     else:
#         return source
# 
# def my_cheap_repr(x):
#     return cheap_repr(x, target_length=REPR_TARGET_LENGTH)
# 
# def ensure_tuple(x, split=False):
#     if split and isinstance(x, six.string_types):
#         x = x.replace(',', ' ').split()
#     if not isinstance(x, (list, set, tuple)):
#         x = (x,)
#     return tuple(x)


# Path: snoop/variables.py
import itertools
import six
from copy import deepcopy
from snoop.utils import with_needed_parentheses, my_cheap_repr, ensure_tuple
    from collections import Mapping, Sequence
    from collections.abc import Mapping, Sequence


    def _keys(self, main_value):
        return ()

    def _format_key(self, key):
        raise NotImplementedError

    def _get_value(self, main_value, key):
        raise NotImplementedError


class Attrs(CommonVariable):
    def _keys(self, main_value):
        return itertools.chain(
            getattr(main_value, '__dict__', ()),
            getattr(main_value, '__slots__', ())
        )

    def _format_key(self, key):
        return '.' + key

    def _get_value(self, main_value, key):
        return getattr(main_value, key)


class Keys(CommonVariable):
    def _keys(self, main_value):
        return main_value.keys()

    def _format_key(self, key):

        return '[{}]'.format(my_cheap_repr(key).replace('\n', ' ').replace('\r', ' '))