code: def _get_mock_module(config):
      """
      Import and return the actual "mock" module. By default this is "mock" for Python 2 and
      "unittest.mock" for Python 3, but the user can force to always use "mock" on Python 3 using
      the mock_use_standalone_module ini option.
      """
      if not hasattr(_get_mock_module, "_module"):
          use_standalone_module = parse_ini_boolean(
              config.getini("mock_use_standalone_module")
          )
          if sys.version_info[0] == 2 or use_standalone_module:
              import mock
  
              _get_mock_module._module = mock
          else:
              import unittest.mock
  
              _get_mock_module._module = unittest.mock
  
      return _get_mock_module._module
  
imports: from __future__ import unicode_literals
  import functools
  import inspect
  import sys
  import pytest
  import six
  from ._version import version
label_desc: Use image node_id 1 for calling a global function with example usage: _get_mock_module(config) and returns: _get_mock_module