code: def get_name_modifier_func(
      rules=None, name_modifier=None, parent_modifier=None
  ):
      if name_modifier is None:
          return None
      else:
          if parent_modifier is None:
              parent_modifier_func = lambda rulename: rulename
          else:
              parent_modifier_func = parent_modifier.modify_rulename
          if "*" in name_modifier:
              return lambda rulename: parent_modifier_func(
                  name_modifier.replace("*", rulename)
              )
          elif name_modifier is not None:
              if len(rules) > 1:
                  raise SyntaxError(
                      "Multiple rules in 'use rule' statement but name modification ('as' statement) does not contain a wildcard '*'."
                  )
              return lambda rulename: parent_modifier_func(
                  name_modifier
              )
  
imports: from pathlib import Path
  import types
  import re
  from snakemake.common import Rules
  from snakemake.exceptions import WorkflowError
  from snakemake.path_modifier import PathModifier
  from snakemake import wrapper
label_desc: Use image node_id 1 for calling a global function with example usage: get_name_modifier_func(rules, name_modifier, parent_modifier) and returns: None, function, function