code: def mocker(pytestconfig):
      """
      return an object that has the same interface to the `mock` module, but
      takes care of automatically undoing all patches after each test method.
      """
      result = MockFixture(pytestconfig)
      yield result
      result.stopall()
  
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 2 for calling a global function with example usage: mocker(pytestconfig) without return types