def memoryit_block(group_by='lineno', limit=10, label='code block'):
    """
    追踪代码块内存消耗情况

    :param group_by: 统计分组，有 'filename', 'lineno', 'traceback' 可选
    :param limit: 限制输出行数
    :param label: 代码块标签
    """
    tracemalloc.start()
    _start = tracemalloc.take_snapshot()
    try:
        yield
    finally:
        _end = tracemalloc.take_snapshot()
        stats = _end.compare_to(_start, group_by)
        _print(stats, limit, label)
def memoryit_block(group_by='lineno', limit=10, label='code block'):
    """
    追踪代码块内存消耗情况

    :param group_by: 统计分组，有 'filename', 'lineno', 'traceback' 可选
    :param limit: 限制输出行数
    :param label: 代码块标签
    """
    tracemalloc.start()
    _start = tracemalloc.take_snapshot()
    try:
        yield
    finally:
        _end = tracemalloc.take_snapshot()
        stats = _end.compare_to(_start, group_by)
        _print(stats, limit, label)
def memoryit_block ( group_by = 'lineno' , limit = 10 , label = 'code block' ) : tracemalloc . start ( ) _start = tracemalloc . take_snapshot ( ) try : yield finally : _end = tracemalloc . take_snapshot ( ) stats = _end . compare_to ( _start , group_by ) _print ( stats , limit , label )
追踪代码块内存消耗情况

    :param group_by: 统计分组，有 'filename', 'lineno', 'traceback' 可选
    :param limit: 限制输出行数
    :param label: 代码块标签
追踪代码块内存消耗情况