code: def _change_dirname(dirname, pattern_list, new_dirname):
      if new_dirname == dirname:
          return pattern_list
      rel = relpath(dirname, new_dirname)
      if rel.startswith(".."):
          raise ValueError(
              "change dirname can only change to parent path"
          )
  
      return [
          PatternInfo(change_rule(rule.patterns, rel), rule.file_info)
          for rule in pattern_list
      ]
  
file_path: dvc/dvc/pathspec_math.py
imports: from collections import namedtuple
  from pathspec.util import normalize_file
  from dvc.utils import relpath
label_desc: Use image node_id 6 for calling a global function with example usage: _change_dirname(dirname, pattern_list, new_dirname) and returns: unknown, pattern_list