def METHOD_NAME(modules_to_patch):
  """Monkey-patch calls to MD5 that aren't used for security purposes.
  Sets RHEL's custom flag `usedforsecurity` to False allowing MD5 in FIPS mode.
  `modules_to_patch` must be an iterable of module names (strings).
  Modules must use `import hashlib` and not `from hashlib import md5`.
  """
  orig_hashlib_md5 = hashlib.md5
  def _non_security_md5(*args, **kwargs):
    kwargs['usedforsecurity'] = False
    return orig_hashlib_md5(*args, **kwargs)
  LOG.debug("Start monkey patch md5 ...")
  if sys.version_info[0] > 2:
    hashlib_spec = importlib.util.find_spec('hashlib')
    patched_hashlib = importlib.util.module_from_spec(hashlib_spec)
    hashlib_spec.loader.exec_module(patched_hashlib)
  else:
    patched_hashlib = imp.load_module('hashlib', *imp.find_module('hashlib'))
  patched_hashlib.md5 = _non_security_md5
  # Inject the patched hashlib for all requested modules
  for module_name in modules_to_patch:
    module = importlib.import_module(module_name)
    module.hashlib = patched_hashlib
  LOG.debug("Finish monkey patch md5 ...")