code: def build_writers(self):
      writers = super().build_writers()
      writers.append(SampleCountMetricPrinter())
      return writers
  
imports: import logging
  import os
  from collections import OrderedDict
  from typing import List, Optional, Union
  import torch
  from torch import nn
  from detectron2.checkpoint import DetectionCheckpointer
  from detectron2.config import CfgNode
  from detectron2.engine import DefaultTrainer
  from detectron2.evaluation import DatasetEvaluator, DatasetEvaluators, inference_on_dataset, print_csv_format
  from detectron2.solver.build import get_default_optimizer_params, maybe_add_gradient_clipping
  from detectron2.utils import comm
  from detectron2.utils.events import EventWriter, get_event_storage
  from densepose import DensePoseDatasetMapperTTA, DensePoseGeneralizedRCNNWithTTA, load_from_cfg
  from densepose.data import DatasetMapper, build_combined_loader, build_detection_test_loader, build_detection_train_loader, build_inference_based_loaders, has_inference_based_loaders
  from densepose.evaluation.d2_evaluator_adapter import Detectron2COCOEvaluatorAdapter
  from densepose.evaluation.evaluator import DensePoseCOCOEvaluator, build_densepose_evaluator_storage
  from densepose.modeling.cse import Embedder
label_desc: Use image node_id 7 for calling the Trainer obj's underlying member method code with example usage: obj.build_writers() and returns: writers