<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def failure_packages(self, failure_index=None):
 """Get packages involved in a failure. Args: failure_index: See `failure_reason`. Returns: A list of Requirement objects. """

        phase, _ = self._get_failed_phase(failure_index)
        fr = phase.failure_reason
        return fr.involved_requirements() if fr else None