<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _prune(self, pop_candidates):
 """Choose a subset of the candidate states to continue on to the next generation. :param pop_candidates: The set of candidate states. """

        return set(
            sorted(pop_candidates, key=self._score, reverse=True)
            [:self.args.max_pop]
        )