<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _populate_affected_issues(self, graph: TraceGraph) -> None: """Populates the trimmed graph with issues whose locations are in affected_files based on data in the input graph. Since these issues exist in the affected files, all traces are copied as well. """

        affected_instance_ids = [
            instance.id.local_id
            for instance in graph._issue_instances.values()
            if self._is_filename_prefixed_with(
                graph.get_text(instance.filename_id), self._affected_files
            )
        ]

        for instance_id in affected_instance_ids:
            if instance_id in self._issue_instances:
                continue
            self._populate_issue_and_traces(graph, instance_id)