code: def stop_watching_memory():
      """Unregister memory profiling tools from IPython instance."""
      global watching_memory
      watching_memory = False
      ip = get_ipython()
      try:
          ip.events.unregister("post_run_cell", watch_memory)
      except ValueError:
          print("ERROR: problem when unregistering")
          pass
      try:
          ip.events.unregister("pre_run_cell", pre_run_cell)
      except ValueError:
          print("ERROR: problem when unregistering")
          pass
  
file_path: recommenders/recommenders/utils/notebook_memory_management.py
imports: from __future__ import division
  from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import unicode_literals
  import time
  import memory_profiler
  from IPython import get_ipython
  import psutil
  import warnings
label_desc: Use image node_id 2 for calling a global function with example usage: stop_watching_memory() without return types