<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def initialize_instrument_classpath(output_dir, settings, targets, instrumentation_classpath):
 """Clones the existing runtime_classpath and corresponding binaries to instrumentation specific paths. :param targets: the targets for which we should create an instrumentation_classpath entry based on their runtime_classpath entry. """

    instrument_dir = os.path.join(output_dir, 'coverage', 'classes')
    settings.safe_makedir(instrument_dir, clean=True)

    for target in targets:
      if not Cobertura.is_coverage_target(target):
        continue
      # Do not instrument transitive dependencies.
      paths = instrumentation_classpath.get_for_target(target)
      target_instrumentation_path = os.path.join(instrument_dir, target.id)
      for (index, (config, path)) in enumerate(paths):
        # There are two sorts of classpath entries we see in the compile classpath: jars and dirs.
        # The branches below handle the cloning of those respectively.
        entry_instrumentation_path = os.path.join(target_instrumentation_path, str(index))
        if settings.is_file(path):
          settings.safe_makedir(entry_instrumentation_path, clean=True)
          settings.copy2(path, entry_instrumentation_path)
          new_path = os.path.join(entry_instrumentation_path, os.path.basename(path))
        else:
          settings.copytree(path, entry_instrumentation_path)
          new_path = entry_instrumentation_path

        instrumentation_classpath.remove_for_target(target, [(config, path)])
        instrumentation_classpath.add_for_target(target, [(config, new_path)])
        settings.log.debug(
          "runtime_classpath ({}) cloned to instrument_classpath ({})".format(path, new_path))