docs: def MERGE(*args):
      """
      Wipe repeated dependencies from a list of (Analysis, id, filename) tuples,
      supplied as argument. Replace id with the correct filename.
      """
  
      # Get the longest common path
      common_prefix = os.path.dirname(os.path.commonprefix([os.path.abspath(a.scripts[-1][1]) for a, _, _ in args]))
      if common_prefix[-1] != os.sep:
          common_prefix += os.sep
      logger.info("Common prefix: %s", common_prefix)
      # Adjust dependencies for each Analysis object; the first Analysis in the
      # list will include all dependencies.
      id_to_path = {}
      for _, i, p in args:
          id_to_path[i] = p
      dependencies = {}
      for analysis, _, _ in args:
          path = os.path.abspath(analysis.scripts[-1][1]).replace(common_prefix, "", 1)
          path = os.path.splitext(path)[0]
          if path in id_to_path:
              path = id_to_path[path]
          set_dependencies(analysis, dependencies, path)