code: def _serialize_outs(outputs: List[Output]):
      outs, metrics, plots = [], [], []
      for out in sorted(outputs, key=attrgetter("def_path")):
          bucket = outs
          if out.plot:
              bucket = plots
          elif out.metric:
              bucket = metrics
          bucket.append(_serialize_out(out))
      return outs, metrics, plots
  
file_path: dvc/dvc/stage/serialize.py
imports: from collections import OrderedDict
  from operator import attrgetter
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Union, no_type_check
  from funcy import post_processing
  from dvc.dependency import ParamsDependency
  from dvc.output import Annotation, Output
  from dvc.utils.collections import apply_diff
  from dvc.utils.serialize import parse_yaml_for_update
  from .params import StageParams
  from .utils import resolve_wdir, split_params_deps
label_desc: Use image node_id 3 for calling a global function with example usage: _serialize_outs(outputs) and returns: outs,  metrics,  plots