code: def _prune_overlapping_targets(merge, prefer_nonsource=False):
      """Removes merge `to_copy` files with overlapping target paths.
  
      Overlapping targets may occur because Guild supports two categries
      of files for merge: source code and non-source code. Non-source
      code files include dependencies and generated files.
  
      `merge.files` may be modified as a result of calling this function.
  
      By default, the pruning prefers source code files over non-source
      code files. In the default case, when a target path exists both as
      source code and as non-source code, the source code file is
      retained and the non-source code file is pruned.
  
      To prefer non-source code files over source code files, specify
      `prefer_nonsource=True`.
      """
      source_lookup = {
          cf.target_path for cf in merge.to_copy if cf.file_type == "s"
      }
      nonsource_lookup = {
          cf.target_path for cf in merge.to_copy if cf.file_type != "s"
      }
      merge.to_copy[:] = [
          cf
          for cf in merge.to_copy
          if _keep_for_prune_overlapping(
              cf,
              source_lookup,
              nonsource_lookup,
              prefer_nonsource,
          )
      ]
  
imports: from collections import namedtuple
  import errno
  import fnmatch
  import logging
  import os
  import shutil
  from guild import file_util
  from guild import run_manifest
label_desc: Use image node_id 30 for calling a global function with example usage: _prune_overlapping_targets(merge, prefer_nonsource) without return types