code: def _get_flags(out):
      annot = out.annot.to_dict()
      yield from annot.items()
  
      if not out.use_cache:
          yield PARAM_CACHE, False
      if out.persist:
          yield PARAM_PERSIST, True
      if out.plot and isinstance(out.plot, dict):
          # notice `out.plot` is not sorted
          # `out.plot` is in the same order as is in the file when read
          # and, should be dumped as-is without any sorting
          yield from out.plot.items()
      if out.remote:
          yield PARAM_REMOTE, out.remote
      if not out.can_push:
          yield PARAM_PUSH, False
  
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 1 for calling a global function with example usage: _get_flags(out) without return types