<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def record_stage_state(self, phase, stage):
 """Record the completion times of phases and stages"""


        key = '{}-{}'.format(phase, stage if stage else 1)

        self.buildstate.state[key] = time()