@line_cell_magic
    def memit(self, line='', cell=None):
        from memory_profiler import memory_usage, _func_exec
        opts, stmt = self.parse_options(line, 'r:t:i:c', posix=False, strict=False)

        if cell is None:
            setup = 'pass'
        else:
            setup = stmt
            stmt = cell

        repeat = int(getattr(opts, 'r', 1))
        if repeat < 1:
            repeat == 1
        timeout = int(getattr(opts, 't', 0))
        if timeout <= 0:
            timeout = None
        interval = float(getattr(opts, 'i', 0.1))
        include_children = 'c' in opts

        # I've noticed we get less noisier measurements if we run
        # a garbage collection first
        import gc
        gc.collect()

        _func_exec(setup, self.shell.user_ns)

        mem_usage = 0
        counter = 0
        baseline = memory_usage()[0]
        while counter < repeat:
            counter += 1
            tmp = memory_usage((_func_exec, (stmt, self.shell.user_ns)),
                               timeout=timeout, interval=interval, max_usage=True,
                               include_children=include_children)
            mem_usage = max(mem_usage, tmp[0])

        if mem_usage:
            print('peak memory: %.02f MiB, increment: %.02f MiB' %
                  (mem_usage, mem_usage - baseline))
        else:
            print('ERROR: could not read memory usage, try with a lower interval '
                  'or more iterations')
This test will esnure that objects are pruned (removed) when the 
dataset/ETHPy150Open fabianp/memory_profiler/memory_profiler.py/MemoryProfilerMagics.memit--crossover with--dataset/ETHPy150Open callowayproject/django-kamasutra/positions/tests.py/PositionsTestCase.testPrune