code: def replace_param(root, path_list, value):
      for here in path_list[:-1]:
          root = getattr(root, here)
  
      param_name = path_list[-1]
      annotation = root.__class__.__annotations__[param_name]
      type_root = resolve_optional(annotation)
      setattr(root, param_name, cast_str(type_root, value))
  
imports: from typing import Dict, List, Union
label_desc: Use image node_id 5 for calling a global function with example usage: replace_param(root, path_list, value) without return types