code: def replace_prefix(self, path, property=None):
      if (self.trie is None and self.prefix is None) or (
          property in self.skip_properties
          or os.path.isabs(path)
          or path.startswith("..")
          or is_flagged(path, "storage_object")
          or is_callable(path)
      ):
          # no replacement
          return path
  
      if self.trie is not None:
          prefixes = self.trie.prefix_items(str(path))
          if len(prefixes) > 1:
              # ambiguous prefixes
              raise WorkflowError(
                  "Multiple prefixes ({}) match the path {}. Make sure that the replace_prefix statement "
                  "in your module definition does not yield ambiguous matches.".format(
                      ", ".join(prefix[0] for prefix in prefixes), path
                  )
              )
          elif prefixes:
              # replace prefix
              prefix, replacement = prefixes[0]
              return replacement + path[len(prefix) :]
          else:
              # no matching prefix
              return path
      else:
          # prefix case
          return self.prefix + path
  
file_path: snakemake/snakemake/path_modifier.py
imports: import os
  from snakemake.exceptions import WorkflowError
  from snakemake.io import is_callable, is_flagged, AnnotatedString, flag, get_flag_value
label_desc: Use image node_id 3 for calling the PathModifier obj's underlying member method code with example usage: obj.replace_prefix(path, property) and returns: path, unknown, unknown, path