code: def test_params_sorted(dvc):
      params = [
          "lorem",
          "ipsum",
          {"custom.yaml": ["wxyz", "pqrs", "baz"]},
          {"params.yaml": ["barr"]},
      ]
      stage = create_stage(
          PipelineStage,
          dvc,
          outs=["bar"],
          deps=["foo"],
          params=params,
          **kwargs,
      )
      assert to_pipeline_file(stage)["something"][
          stage.PARAM_PARAMS
      ] == [
          "barr",
          "ipsum",
          "lorem",
          {"custom.yaml": ["baz", "pqrs", "wxyz"]},
      ]
  
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 6 for calling a global function with example usage: test_params_sorted(dvc) without return types