# Path: pympler/summary.py
# def _init_representations():
# def summarize(objects):
# def get_diff(left, right):
# def format_(rows, limit=15, sort='size', order='descending'):
# def _format_table(rows, header=True):
# def print_(rows, limit=15, sort='size', order='descending'):
# def _repr(o, verbosity=1):
# def _traverse(summary, function, *args):
# def _subtract(summary, o):
# def _sweep(summary):
# 
# Path: pympler/muppy.py
# def ignore_object(obj: Any) -> bool:
# def get_objects(remove_dups: bool = True, include_frames: bool = False
#                 ) -> List[Any]:
# def get_size(objects: List[Any]) -> int:
# def get_diff(left: List[Any], right: List[Any]) -> Dict[str, List[Any]]:
#     def partition(objects: List[Any]) -> Dict[type, List[Any]]:
#     def get_not_included(foo: List[Any], bar: Dict[type, List[Any]]
#                          ) -> List[Any]:
# def sort(objects: List[Any]) -> List[Any]:
# def filter(objects: List[Any], Type: Optional[type] = None, min: int = -1,
#            max: int = -1) -> List[Any]:
# def get_referents(object: Any, level: int = 1) -> List[Any]:
# def _get_usage(function: Callable, *args: Any) -> Optional[List]:
#     def _get_summaries(function: Callable, *args: Any) -> Tuple:
#     def _get_usage(function: Callable, *args: Any) -> List:
#     def noop() -> None:
# def _is_containerobject(o: Any) -> bool:
# def _remove_duplicates(objects: List[Any]) -> List[Any]:
# def print_summary() -> None:


import doctest
import sys
import unittest
from io import StringIO
from sys import getsizeof
from pympler import summary, muppy
        """

        objects = ['the', 'quick', 'brown', 'fox', 1298, 123, 234, [], {}]
        summ = summary.summarize(objects)
        summary._subtract(summ, 'the')
        summary._subtract(summ, {})
        summary._subtract(summ, (1,))
        # to verify that these rows where actually included afterwards
        checked_str = checked_dict = checked_tuple = False
        for row in summ:
            if row[0] == summary._repr(''):
                totalsize = getsizeof('quick') + getsizeof('brown') +\
                            getsizeof('fox')
                self.assertTrue(row[1] == 3, "%s != %s" % (row[1], 3))
                self.assertTrue(row[2] == totalsize, totalsize)
                checked_str = True
            if row[0] == summary._repr({}):
                self.assertTrue(row[1] == 0)
                self.assertTrue(row[2] == 0)
                checked_dict = True
            if row[0] == summary._repr((1,)):
                self.assertTrue(row[1] == -1)
                self.assertTrue(row[2] == -getsizeof((1,)))
                checked_tuple = True

        self.assertTrue(checked_str, "no str found in summary")
        self.assertTrue(checked_dict, "no dict found in summary")
        self.assertTrue(checked_tuple, "no tuple found in summary")

        summary._subtract(summ, 'quick')

# Path: pympler/summary.py
# def _init_representations():
# def summarize(objects):
# def get_diff(left, right):
# def format_(rows, limit=15, sort='size', order='descending'):
# def _format_table(rows, header=True):
# def print_(rows, limit=15, sort='size', order='descending'):
# def _repr(o, verbosity=1):
# def _traverse(summary, function, *args):
# def _subtract(summary, o):
# def _sweep(summary):
# 
# Path: pympler/muppy.py
# def ignore_object(obj: Any) -> bool:
# def get_objects(remove_dups: bool = True, include_frames: bool = False
#                 ) -> List[Any]:
# def get_size(objects: List[Any]) -> int:
# def get_diff(left: List[Any], right: List[Any]) -> Dict[str, List[Any]]:
#     def partition(objects: List[Any]) -> Dict[type, List[Any]]:
#     def get_not_included(foo: List[Any], bar: Dict[type, List[Any]]
#                          ) -> List[Any]:
# def sort(objects: List[Any]) -> List[Any]:
# def filter(objects: List[Any], Type: Optional[type] = None, min: int = -1,
#            max: int = -1) -> List[Any]:
# def get_referents(object: Any, level: int = 1) -> List[Any]:
# def _get_usage(function: Callable, *args: Any) -> Optional[List]:
#     def _get_summaries(function: Callable, *args: Any) -> Tuple:
#     def _get_usage(function: Callable, *args: Any) -> List:
#     def noop() -> None:
# def _is_containerobject(o: Any) -> bool:
# def _remove_duplicates(objects: List[Any]) -> List[Any]:
# def print_summary() -> None:


# Path: test/muppy/test_summary.py
import doctest
import sys
import unittest
from io import StringIO
from sys import getsizeof
from pympler import summary, muppy

        """

        objects = ['the', 'quick', 'brown', 'fox', 1298, 123, 234, [], {}]
        summ = summary.summarize(objects)
        summary._subtract(summ, 'the')
        summary._subtract(summ, {})
        summary._subtract(summ, (1,))
        # to verify that these rows where actually included afterwards
        checked_str = checked_dict = checked_tuple = False
        for row in summ:
            if row[0] == summary._repr(''):
                totalsize = getsizeof('quick') + getsizeof('brown') +\
                            getsizeof('fox')
                self.assertTrue(row[1] == 3, "%s != %s" % (row[1], 3))
                self.assertTrue(row[2] == totalsize, totalsize)
                checked_str = True
            if row[0] == summary._repr({}):
                self.assertTrue(row[1] == 0)
                self.assertTrue(row[2] == 0)
                checked_dict = True
            if row[0] == summary._repr((1,)):
                self.assertTrue(row[1] == -1)
                self.assertTrue(row[2] == -getsizeof((1,)))
                checked_tuple = True

        self.assertTrue(checked_str, "no str found in summary")
        self.assertTrue(checked_dict, "no dict found in summary")
        self.assertTrue(checked_tuple, "no tuple found in summary")

        summary._subtract(summ, 'quick')

        summary._subtract(summ, 'brown')