code: def _sorted_dict(sample: Sample) -> Sample:
      """Sort the keys of a dict."""
      return dict(sorted(sample.items()))
  
imports: from __future__ import annotations
  import itertools
  import logging
  import random
  import warnings
  from typing import Any, cast
  import nni
  from nni.mutable import Sample, Mutable, LabeledMutable, Categorical, CategoricalMultiple, label_scope
  from nni.nas.evaluator import Evaluator
  from nni.nas.space import ExecutableModelSpace
  from .space import SlimBenchmarkSpace
label_desc: Use image node_id 4 for calling a global function with example usage: _sorted_dict(sample) and returns: dict