<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def control_number(endpoint):
 """Populate the ``control_number`` key. Also populates the ``self`` key through side effects. """

    def _control_number(self, key, value):
        self['self'] = get_record_ref(int(value), endpoint)
        return int(value)

    return _control_number