code: def __init__(self, train_dirs, subdirs=False):
      super(self.__class__, self).__init__()
      if isinstance(train_dirs, str):
          train_dirs = [train_dirs]
      if subdirs:
          train_subdirs = []
          for train_dir in train_dirs:
              train_subdirs.extend(self._get_subdirectories(train_dir))
          train_dirs = train_subdirs
      self._train_dirs = train_dirs[:]
      self._names = []
      curdir = os.path.abspath(os.path.curdir)
      for train_dir in train_dirs:
          abspath = os.path.abspath(train_dir)
          self._names.append(
              os.path.basename(abspath)
              if abspath != curdir
              else "current"
          )
      self._need_to_stop = Event()
      self._update_after_stop_signal = False
  
file_path: catboost/catboost/python-package/catboost/widget/ipythonwidget.py
imports: import os
  import json
  from threading import Thread, Event
  from traitlets import Unicode, Dict, default
  from IPython.display import display
  from ipywidgets import DOMWidget, Layout, widget_serialization
label_desc: Use image node_id 1 to create a new MetricVisualizer object from inherited base classes: MetricWidget with example: obj = MetricVisualizer(train_dirs, subdirs)