code: def test_non_repeating_log_factory(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)
      log_function("foo")
      log_function("foo")
  
      mock.assert_called_once()
  
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 28 for calling a global function with example usage: test_non_repeating_log_factory(method_name) without return types