code: def pytest_terminal_summary(
      terminalreporter, exitstatus, config
  ):  # pylint: disable=unused-argument
      yield
      failed_test_reports = terminalreporter.stats.get("failed", [])
      if failed_test_reports:
          if len(failed_test_reports) <= 30:
              terminalreporter.section(
                  "command to run failed test cases"
              )
              ids = [
                  repr(report.nodeid) for report in failed_test_reports
              ]
          else:
              terminalreporter.section(
                  "command to run failed test suites"
              )
              # Use dict.fromkeys to preserve the order
              ids = list(
                  dict.fromkeys(
                      report.fspath for report in failed_test_reports
                  )
              )
          terminalreporter.write(" ".join(["pytest"] + ids))
          terminalreporter.write("\n" * 2)
  
          # If some tests failed at installing mlflow, we suggest using `--serve-wheel` flag.
          # Some test cases try to install mlflow via pip e.g. model loading. They pins
          # mlflow version to install based on local environment i.e. dev version ahead of
          # the latest release, hence it's not found on PyPI. `--serve-wheel` flag was
          # introduced to resolve this issue, which starts local PyPI server and serve
          # an mlflow wheel based on local source code.
          # Ref: https://github.com/mlflow/mlflow/pull/10247
          msg = f"No matching distribution found for mlflow=={VERSION}"
          for rep in failed_test_reports:
              if any(
                  msg in t
                  for t in (
                      rep.longreprtext,
                      rep.capstdout,
                      rep.capstderr,
                  )
              ):
                  terminalreporter.section("HINTS", yellow=True)
                  terminalreporter.write(
                      f"Found test(s) that failed with {msg!r}. Adding"
                      " --serve-wheel` flag to your pytest command may help.\n\n",
                      yellow=True,
                  )
                  break
  
imports: import json
  import os
  import posixpath
  import shutil
  import subprocess
  import sys
  import click
  import pytest
  from mlflow.environment_variables import _MLFLOW_TESTING, MLFLOW_TRACKING_URI
  from mlflow.version import VERSION
  from tests.helper_functions import get_safe_port
label_desc: Use image node_id 11 for calling a global function with example usage: pytest_terminal_summary(terminalreporter, exitstatus, config) without return types