code: def assert_not_called_workaround(mock):
      """Asserts that a mock has not been called.
  
      There's a bug in mock where some of the assert functions on a mock are being
      dropped when that mock is created with an autospec:
  
        https://bugs.python.org/issue28380
  
      The mock 2.0.0 backport doesn't have the fix yet. The required patch is:
  
        https://bugs.python.org/file44991/fix_autospecced_mock_functions.patch
  
      but the current mock (checked 07/22/17) backport code is missing the fix:
  
        https://github.com/testing-cabal/mock/blob/master/mock/mock.py#L315
  
      This is an open issue on the mock github repo:
  
        https://github.com/testing-cabal/mock/issues/398
  
      And they claim that it'll be a few months (as of April 2017) before it is
      incorporated into the backport.
  
      Args:
        mock: The mock to assert hasn't been called.
  
      Raises:
        AssertionError: mock has been called.
      """
      if mock.call_count != 0:
          raise AssertionError(
              "Expected no calls to '{}' but was called {} times".format(
                  mock.name, mock.call_count
              )
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl import flags
  from absl.testing import absltest
  from etils import epath
  import six
  from third_party.nucleus.protos import position_pb2
  from third_party.nucleus.protos import reads_pb2
  from third_party.nucleus.protos import struct_pb2
  from third_party.nucleus.protos import variants_pb2
  from third_party.nucleus.util import cigar
label_desc: Use image node_id 10 for calling a global function with example usage: assert_not_called_workaround(mock) without return types