class_docstr: A running stat for conveniently logging the duration of a code block.
  
  Note that this class is *not* thread-safe.
  
  Examples:
      Time a call to 'time.sleep'.
  
      >>> import time
      >>> sleep_timer = TimerStat()
      >>> with sleep_timer:
      ...     time.sleep(1)
      >>> round(sleep_timer.mean)
      1
code: def push(self, time_delta):
      self._samples.append(time_delta)
      if len(self._samples) > self._window_size:
          self._samples.pop(0)
      self.count += 1
      self._total_time += time_delta
  
imports: import collections
  from contextlib import closing, contextmanager
  import logging
  import numpy
  import socket
  import time
label_desc: Use image node_id 4 for calling the TimerStat obj's underlying member method code with example usage: obj.push(time_delta) without return types