<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _ivy_resolve(self, targets, executor=None, silent=False, workunit_name=None, confs=None, extra_args=None, invalidate_dependents=False, pinned_artifacts=None):
 """Resolves external dependencies for the given targets. If there are no targets suitable for jvm transitive dependency resolution, an empty result is returned. :param targets: The targets to resolve jvm dependencies for. :type targets: :class:`collections.Iterable` of :class:`pants.build_graph.target.Target` :param executor: A java executor to run ivy with. :type executor: :class:`pants.java.executor.Executor` :param confs: The ivy configurations to resolve; ('default',) by default. :type confs: :class:`collections.Iterable` of string :param extra_args: Any extra command line arguments to pass to ivy. :type extra_args: list of string :param bool invalidate_dependents: `True` to invalidate dependents of targets that needed to be resolved. :returns: The result of the resolve. :rtype: IvyResolveResult """

    # If there are no targets, we don't need to do a resolve.
    if not targets:
      return NO_RESOLVE_RUN_RESULT

    confs = confs or ('default',)

    fingerprint_strategy = IvyResolveFingerprintStrategy(confs)

    with self.invalidated(targets,
                          invalidate_dependents=invalidate_dependents,
                          silent=silent,
                          fingerprint_strategy=fingerprint_strategy) as invalidation_check:
      # In case all the targets were filtered out because they didn't participate in fingerprinting.
      if not invalidation_check.all_vts:
        return NO_RESOLVE_RUN_RESULT

      resolve_vts = VersionedTargetSet.from_versioned_targets(invalidation_check.all_vts)

      resolve_hash_name = resolve_vts.cache_key.hash
      # NB: This used to be a global directory, but is now specific to each task that includes
      # this mixin.
      ivy_workdir = os.path.join(self.versioned_workdir, 'ivy')
      targets = resolve_vts.targets

      fetch = IvyFetchStep(confs,
                           resolve_hash_name,
                           pinned_artifacts,
                           self.get_options().soft_excludes,
                           self.ivy_resolution_cache_dir,
                           self.ivy_repository_cache_dir,
                           ivy_workdir)
      resolve = IvyResolveStep(confs,
                               resolve_hash_name,
                               pinned_artifacts,
                               self.get_options().soft_excludes,
                               self.ivy_resolution_cache_dir,
                               self.ivy_repository_cache_dir,
                               ivy_workdir)

      return self._perform_resolution(fetch, resolve, executor, extra_args, invalidation_check,
                                      resolve_vts, targets, workunit_name)