code: def test_outs_and_outs_flags_are_sorted(dvc, typ, extra):
      stage = create_stage(PipelineStage, dvc, deps=["input"], **kwargs)
      stage.outs += output.loads_from(
          stage, ["barr"], use_cache=False, **extra
      )
      stage.outs += output.loads_from(
          stage, ["foobar"], use_cache=False, persist=True, **extra
      )
      stage.outs += output.loads_from(
          stage, ["foo"], persist=True, **extra
      )
      stage.outs += output.loads_from(stage, ["bar"], **extra)
  
      serialized_outs = to_pipeline_file(stage)["something"][typ]
      assert serialized_outs == [
          "bar",
          {"barr": {"cache": False}},
          {"foo": {"persist": True}},
          {"foobar": {"cache": False, "persist": True}},
      ]
      assert list(serialized_outs[3]["foobar"].keys()) == [
          "cache",
          "persist",
      ]
  
imports: import os
  import pytest
  from voluptuous import Schema
  from dvc import output
  from dvc.dvcfile import PROJECT_FILE
  from dvc.schema import SINGLE_PIPELINE_STAGE_SCHEMA
  from dvc.stage import PipelineStage, create_stage
  from dvc.stage.serialize import to_pipeline_file
label_desc: Use image node_id 9 for calling a global function with example usage: test_outs_and_outs_flags_are_sorted(dvc, typ, extra) without return types