code: def _log_metrics_as_summaries(state):
      with summary.SummaryWriter(state.run_dir) as events:
          for (
              metrics_name,
              metrics_data,
          ) in dvc_util.iter_stage_metrics_data(
              state.target_stage,
              state.run_dir,
          ):
              log.info("Logging metrics from %s", metrics_name)
              for tag, val in _iter_metrics_scalars(metrics_data):
                  events.add_scalar(tag, val)
  
imports: import argparse
  import logging
  import os
  import subprocess
  import yaml
  from guild import op_util
  from guild import run
  from guild import run_manifest
  from guild import summary
  from guild import util
  from .None import dvc_util
label_desc: Use image node_id 34 for calling a global function with example usage: _log_metrics_as_summaries(state) without return types