code: def test_non_repeating_log_factory_cache_size(method_name):
      tmp_logger = logging.getLogger("test-logger")
      mock = MagicMock()
      setattr(tmp_logger, method_name, mock)
  
      log_function = non_repeating_log_factory(
          tmp_logger, method_name, cache_size=2
      )
      log_function("foo")
      log_function("bar")
      log_function("foo2")
      log_function("foo")
  
      assert mock.call_count == 4
  
imports: from __future__ import absolute_import
  import os
  import pytest
  import yaml
  import logging
  from mock import Mock, MagicMock, patch, call
  from sagemaker.config.config import load_local_mode_config, load_sagemaker_config, logger, non_repeating_log_factory, _DEFAULT_ADMIN_CONFIG_FILE_PATH, _DEFAULT_USER_CONFIG_FILE_PATH, _DEFAULT_LOCAL_MODE_CONFIG_FILE_PATH
  from jsonschema import exceptions
  from yaml.constructor import ConstructorError
label_desc: Use image node_id 29 for calling a global function with example usage: test_non_repeating_log_factory_cache_size(method_name) without return types