code: def set_work(self, work):
          
          if not hasattr(self, "_work"):
              self._work = work
          else:
              if self._work != work:
                  raise ValueError("self._work != work")
docs: Set the :class:`Work` associated to this `Task`.