<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate(self, local_go_targets):
 """Automatically generates a Go target graph for the given local go targets. :param iter local_go_targets: The target roots to fill in a target graph for. :raises: :class:`GoTargetGenerator.GenerationError` if any missing targets cannot be generated. """

    visited = {l.import_path: l.address for l in local_go_targets}
    with temporary_dir() as gopath:
      for local_go_target in local_go_targets:
        deps = self._list_deps(gopath, local_go_target.address)
        self._generate_missing(gopath, local_go_target.address, deps, visited)
    return list(visited.items())