code: def freeze_parameters(model, patterns):
      """Set requires_grad to False if patterns match name
  
      Args:
          model: A Module
          patterns: A list of strings that will be used to match parameter names. If parameter name contains any pattern,
              it will be frozen.
      """
      for name, param in model.named_parameters():
          for pattern in patterns:
              if re.search(pattern, name):
                  logger.warning("Freeze %s.", name)
                  param.requires_grad = False
  
imports: import re
  import logging
label_desc: Use image node_id 3 for calling a global function with example usage: freeze_parameters(model, patterns) without return types