code: def from_to_prefix(
      replace_from, replace_to, add_prefix, force_prefix=False
  ):
      def op(var_name):
          # Set the new name
          new_name = var_name
          if None not in [replace_from, replace_to]:
              new_name = new_name.replace(replace_from, replace_to)
          if add_prefix:
              if force_prefix or not new_name.startswith(add_prefix):
                  # force prefix or add prefix if it does not exist yet
                  new_name = add_prefix + new_name
  
          return new_name
  
      return op
  
label_desc: Use image node_id 1 for calling a global function with example usage: from_to_prefix(replace_from, replace_to, add_prefix, force_prefix) and returns: op, new_name