code: def init_run_merge(
      run,
      target_dir,
      copy_all=False,
      skip_sourcecode=False,
      skip_deps=False,
      exclude=None,
      prefer_nonsource=False,
  ):
      manifest_index = _init_manifest_index(run)
      merge = RunMerge(
          run,
          target_dir,
          copy_all=copy_all,
          skip_sourcecode=skip_sourcecode,
          skip_deps=skip_deps,
          exclude=exclude,
          to_copy=[],
          to_skip=[],
      )
      _apply_run_files_to_merge(run, manifest_index, merge)
      _prune_overlapping_targets(merge, prefer_nonsource)
      return merge
  
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 1 for calling a global function with example usage: init_run_merge(run, target_dir, copy_all, skip_sourcecode, skip_deps, exclude, prefer_nonsource) and returns: merge