code: def mock_versioning_api():
      """Fixture that is applied to all tests and mocks the versioning API.
  
      This is necessary because everytime an ApiWorkflowClient instance is created, a call
      to the versioning API is made. This fixture makes sure that these calls succeed
      while not actually sending any requests to the API.
  
      It mocks:
      - VersioningApi.get_latest_pip_version to always return the current version. This
          avoids any errors/warnings related to not using the latest version.
      - VersioningApi.get_minimum_compatible_pip_version to always return 1.0.0 which
          should be compatible with all future versions.
      """
  
      def mock_get_latest_pip_version(
          current_version: str, **kwargs
      ) -> str:
          return current_version
  
      # NOTE(guarin, 2/6/23): Cannot use pytest mocker fixture here because it has not
      # a "module" scope and it is not possible to use a fixture that has a tighter scope
      # inside a fixture with a wider scope.
      with mock.patch(
          "lightly.api._version_checking.VersioningApi.get_latest_pip_version",
          new=mock_get_latest_pip_version,
      ), mock.patch(
          "lightly.api._version_checking.VersioningApi.get_minimum_compatible_pip_version",
          return_value="1.0.0",
      ):
          yield
  
imports: import os
  from unittest import mock
  import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: mock_versioning_api() and returns: current_version