code: def test_search_registered_model_order_by(store):
      rms = []
      # explicitly mock the creation_timestamps because timestamps seem to be unstable in Windows
      for i in range(50):
          rms.append(store.create_registered_model(f"RM{i:03}").name)
          time.sleep(0.01)
  
      # test flow with fixed max_results and order_by (test stable order across pages)
      returned_rms = []
      query = "name LIKE 'RM%'"
      result, token = _search_registered_models(
          store,
          query,
          page_token=None,
          order_by=["name DESC"],
          max_results=5,
      )
      returned_rms.extend(result)
      while token:
          result, token = _search_registered_models(
              store,
              query,
              page_token=token,
              order_by=["name DESC"],
              max_results=5,
          )
          returned_rms.extend(result)
      # name descending should be the opposite order of the current order
      assert returned_rms == rms[::-1]
      # last_updated_timestamp descending should have the newest RMs first
      res = _search_registered_models(
          store,
          query,
          page_token=None,
          order_by=["last_updated_timestamp DESC"],
          max_results=100,
      )
      assert res.names == rms[::-1]
      # last_updated_timestamp ascending should have the oldest RMs first
      res = _search_registered_models(
          store,
          query,
          page_token=None,
          order_by=["last_updated_timestamp ASC"],
          max_results=100,
      )
      assert res.names == rms
      # name ascending should have the original order
      res = _search_registered_models(
          store,
          query,
          page_token=None,
          order_by=["name ASC"],
          max_results=100,
      )
      assert res.names == rms
      # test that no ASC/DESC defaults to ASC
      res = _search_registered_models(
          store,
          query,
          page_token=None,
          order_by=["last_updated_timestamp"],
          max_results=100,
      )
      assert res.names == rms
      with mock.patch(
          "mlflow.store.model_registry.file_store.get_current_time_millis",
          return_value=1,
      ):
          rm1 = store.create_registered_model("MR1").name
          rm2 = store.create_registered_model("MR2").name
      with mock.patch(
          "mlflow.store.model_registry.file_store.get_current_time_millis",
          return_value=2,
      ):
          rm3 = store.create_registered_model("MR3").name
          rm4 = store.create_registered_model("MR4").name
      query = "name LIKE 'MR%'"
      # test with multiple clauses
      res = _search_registered_models(
          store,
          query,
          page_token=None,
          order_by=["last_updated_timestamp ASC", "name DESC"],
          max_results=100,
      )
      assert res.names == [rm2, rm1, rm4, rm3]
      # confirm that name ascending is the default, even if ties exist on other fields
      res = _search_registered_models(
          store, query, page_token=None, order_by=[], max_results=100
      )
      assert res.names == [rm1, rm2, rm3, rm4]
      # test default tiebreak with descending timestamps
      res = _search_registered_models(
          store,
          query,
          page_token=None,
          order_by=["last_updated_timestamp DESC"],
          max_results=100,
      )
      assert res.names == [rm3, rm4, rm1, rm2]
  
imports: import time
  import uuid
  from typing import List, NamedTuple
  from unittest import mock
  import pytest
  from mlflow.entities.model_registry import ModelVersion, ModelVersionTag, RegisteredModelTag
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE, RESOURCE_DOES_NOT_EXIST, ErrorCode
  from mlflow.store.model_registry.file_store import FileStore
  from mlflow.utils.file_utils import path_to_local_file_uri, write_yaml
  from mlflow.utils.time import get_current_time_millis
  from tests.helper_functions import random_int, random_str
label_desc: Use image node_id 35 for calling a global function with example usage: test_search_registered_model_order_by(store) without return types