code: def test_order_by_metric_with_nans_infs_nones():
      metric_vals_str = [
          "nan",
          "inf",
          "-inf",
          "-1000",
          "0",
          "1000",
          "None",
      ]
      runs = [
          Run(
              run_info=RunInfo(
                  run_id=x,
                  run_uuid=x,
                  experiment_id=0,
                  user_id="user",
                  status=RunStatus.to_string(RunStatus.FINISHED),
                  start_time=0,
                  end_time=1,
                  lifecycle_stage=LifecycleStage.ACTIVE,
              ),
              run_data=RunData(
                  metrics=[
                      Metric(
                          "x", None if x == "None" else float(x), 1, 0
                      )
                  ]
              ),
          )
          for x in metric_vals_str
      ]
      sorted_runs_asc = [
          x.info.run_id
          for x in SearchUtils.sort(runs, ["metrics.x asc"])
      ]
      sorted_runs_desc = [
          x.info.run_id
          for x in SearchUtils.sort(runs, ["metrics.x desc"])
      ]
      # asc
      assert sorted_runs_asc == [
          "-inf",
          "-1000",
          "0",
          "1000",
          "inf",
          "nan",
          "None",
      ]
      # desc
      assert sorted_runs_desc == [
          "inf",
          "1000",
          "0",
          "-1000",
          "-inf",
          "nan",
          "None",
      ]
  
imports: import base64
  import json
  import re
  import pytest
  from mlflow.entities import Dataset, DatasetInput, InputTag, LifecycleStage, Metric, Param, Run, RunData, RunInfo, RunInputs, RunStatus, RunTag
  from mlflow.exceptions import MlflowException
  from mlflow.utils.mlflow_tags import MLFLOW_DATASET_CONTEXT
  from mlflow.utils.search_utils import SearchUtils
label_desc: Use image node_id 13 for calling a global function with example usage: test_order_by_metric_with_nans_infs_nones() without return types