def take_snapshot():
 if (not is_tracing()):
  raise RuntimeError('the tracemalloc module must be tracing memory allocations to take a snapshot')
 traces = _get_traces()
 traceback_limit = get_traceback_limit()
 return Snapshot(traces, traceback_limit)

def take_snapshot ( ) : if ( not is_tracing ( ) ) : raise RuntimeError ( 'the tracemalloc module must be tracing memory allocations to take a snapshot' ) traces = _get_traces ( ) traceback_limit = get_traceback_limit ( ) return Snapshot ( traces , traceback_limit )
take a snapshot of traces of memory blocks allocated by python .