code: def num_mock_patch_args(function):
      """return number of arguments used up by mock arguments (if any)"""
      patchings = getattr(function, "patchings", None)
      if not patchings:
          return 0
      mock_modules = [
          sys.modules.get("mock"),
          sys.modules.get("unittest.mock"),
      ]
      if any(mock_modules):
          sentinels = [m.DEFAULT for m in mock_modules if m is not None]
          return len(
              [
                  p
                  for p in patchings
                  if not p.attribute_name and p.new in sentinels
              ]
          )
      return len(patchings)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import codecs
  import functools
  import inspect
  import re
  import sys
  from contextlib import contextmanager
  import attr
  import py
  import six
  from six import text_type
  import _pytest
  from _pytest._io.saferepr import saferepr
  from _pytest.outcomes import fail
  from _pytest.outcomes import TEST_OUTCOME
label_desc: Use image node_id 5 for calling a global function with example usage: num_mock_patch_args(function) and returns: len, int, len