<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _plugin_targets(self, compiler):
 """Returns a map from plugin name to the targets that build that plugin."""

    if compiler == 'javac':
      plugin_cls = JavacPlugin
    elif compiler == 'scalac':
      plugin_cls = ScalacPlugin
    else:
      raise TaskError('Unknown JVM compiler: {}'.format(compiler))
    plugin_tgts = self.context.targets(predicate=lambda t: isinstance(t, plugin_cls))
    return {t.plugin: t.closure() for t in plugin_tgts}