code: def test_differed_logging_message(self):
      # Given
      def fn(a, b, c):
          return a + b + c
  
      mocked_fn = MagicMock()
      mocked_fn.side_effect = fn
  
      class Greeter(object):
          def greet(self):
              return "Yo!"
  
      levels = [logging.DEBUG, logging.INFO, logging.WARNING]
      logger = logging.Logger("my_dummy_logger", logging.INFO)
      logger.addHandler(logging.StreamHandler())
      a_, b_, c_ = 1, 2, 3
  
      with self.fail_if_exception("Failed to log"):
          # When/Then
          my_obj = Greeter()
          logger.log(
              logging.INFO,
              "Greeting: %s",
              DifferedLoggingMessage(my_obj.greet),
          )
          for l in levels:
              logger.log(
                  l,
                  "Level: %s -> %s",
                  str(l),
                  DifferedLoggingMessage(mocked_fn, a_, b_, c=c_),
              )
      self.assertEqual(2, mocked_fn.call_count)
  
imports: from __future__ import unicode_literals
  import logging
  from future.builtins import object, str
  from future.utils import iteritems
  from mock import MagicMock
  from snips_nlu import __model_version__, __version__
  from snips_nlu.common.dict_utils import LimitedSizeDict
  from snips_nlu.common.log_utils import DifferedLoggingMessage
  from snips_nlu.common.utils import ranges_overlap, replace_entities_with_placeholders, parse_version
  from snips_nlu.constants import END, START
  from snips_nlu.preprocessing import tokenize_light
  from snips_nlu.tests.utils import SnipsTest
label_desc: Use image node_id 2 for calling the TestUtils obj's underlying member method code with example usage: obj.test_differed_logging_message() and returns: unknown, str