code: def test_flush_clears_pending_operations():
      with mock.patch(
          "mlflow.utils.autologging_utils.client.MlflowClient",
          autospec=True,
      ) as mlflow_client_mock:
          client = MlflowAutologgingQueueingClient()
  
          pending_run_id = client.create_run(experiment_id=5)
          client.log_params(run_id=pending_run_id, params={"a": "b"})
          client.log_metrics(run_id=pending_run_id, metrics={"c": 1})
          client.set_terminated(
              run_id=pending_run_id, status="FINISHED"
          )
          client.flush()
  
          logging_call_count_1 = len(mlflow_client_mock.method_calls)
          # Verify that at least 3 calls have been made to MLflow logging APIs as a result
          # of the flush (i.e. log_batch, create_run, and set_terminated)
          assert logging_call_count_1 >= 3
  
          client.flush()
  
          logging_call_count_2 = len(mlflow_client_mock.method_calls)
          # Verify that performing a second flush did not result in any additional logging API calls,
          # since no new run content was added prior to the flush
          assert logging_call_count_2 == logging_call_count_1
  
imports: import time
  from unittest import mock
  import pytest
  import mlflow
  from mlflow import MlflowClient
  from mlflow.exceptions import MlflowException
  from mlflow.utils import _truncate_dict
  from mlflow.utils.autologging_utils import MlflowAutologgingQueueingClient
  from mlflow.utils.validation import MAX_ENTITY_KEY_LENGTH, MAX_METRICS_PER_BATCH, MAX_PARAM_VAL_LENGTH, MAX_PARAMS_TAGS_PER_BATCH, MAX_TAG_VAL_LENGTH
label_desc: Use image node_id 10 for calling a global function with example usage: test_flush_clears_pending_operations() without return types