<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_check(self, check):
 """ Please use rather `register_check` as a decorator. """

    if self._add_check_callback is not None:
      if not self._add_check_callback(self, check):
        # rejected, skip!
        return False

    self._checkid2index[check.id] = len(self._checks)
    self._checks.append(check)
    return True