code: def __init__(
      self, exp=None, compact=False, gc_collect=True, set_seed=0
  ):
      # any subclass object of IPyExperiments that gives us access to its
      # specific memory measurement functions
  
      self.backend = exp.backend
  
      if self.backend == "pytorch":
          self.pynvml = exp.pynvml
          self.torch = exp.torch
          self.gpu_current_device_id = exp.gpu_current_device_id
  
      self.compact = compact  # one line printouts
      self.gc_collect = gc_collect  # don't use when tracking mem leaks
      self.set_seed = set_seed  # set RNG seed before each cell is run to the provided value
  
      self.peak_monitoring = False
      self.running = False
  
      self.time_start = 0
      self.time_delta = 0
  
      self.cpu_mem_used_peak = -1
      self.cpu_mem_used_delta = 0
      self.cpu_mem_used_prev = -1
      self.cpu_mem_peaked_delta = -1
  
      self.gpu_mem_used_peak = -1
      self.gpu_mem_used_delta = 0
      self.gpu_mem_used_prev = -1
      self.gpu_mem_peaked_delta = -1
  
      self.ipython = get_ipython()
      # self.input_cells = self.ipython.user_ns['In']
  
      # set at the end of post_run_cell to be read in the subsequent cell
      self.data = CellLoggerData(
          CellLoggerMemory(0, 0, 0),
          CellLoggerMemory(0, 0, 0),
          CellLoggerTime(0),
      )
  
imports: from IPython import get_ipython
  from collections import namedtuple
  import datetime
  import gc
  import logging
  import os
  import psutil
  import random
  import sys
  import threading
  import time
label_desc: Use image node_id 1 to create a new CellLogger object  with example: obj = CellLogger(exp, compact, gc_collect, set_seed)