<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def context(self, outdir, log_prefix):
 """Setup instance to extract metrics from the proper run :param outdir: run directory :param log_prefix: log filenames prefix """

        try:
            self._outdir = outdir
            self._log_prefix = log_prefix
            yield
        finally:
            self._log_prefix = None
            self._outdir = None