<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def targets_for_class(self, target, classname):
 """Search which targets from `target`'s transitive dependencies contain `classname`."""

    targets_with_class = set()
    for target in target.closure():
      for one_class in self._target_classes(target):
        if classname in one_class:
          targets_with_class.add(target)
          break

    return targets_with_class