code: def prune_train_dirs(dir_: str, epochs: int, subdirs: bool) -> None:
      
  
      if dir_ == CXF_DEFAULT_LOG_DIR and not path.exists(CXF_DEFAULT_LOG_DIR):
          print('The default log directory `{}` does not exist.\n'
                'Consider specifying the directory to be listed as an argument.'.format(CXF_DEFAULT_LOG_DIR))
          quit(1)
  
      if not path.exists(dir_):
          print('Specified dir `{}` does not exist'.format(dir_))
          quit(1)
  
      _prune(dir_, epochs)
      if subdirs:
          _prune_subdirs(dir_)
docs: Prune training log dirs contained in the given dir. The function is accessible through cxflow CLI `cxflow prune`.
  
      :param dir_: dir to be pruned
      :param epochs: minimum number of finished epochs to keep the training logs
      :param subdirs: delete subdirs in training log dirs