<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def derive_and_set_slug(self, set_name_sort=True, set_slug=True):
 """ Derive `slug` field from `title` unless it is set in its own right. This method is called during `save()` """

        # `title` is the primary required name field. It must be set.
        if is_empty(self.title):
            raise ValueError(
                u"%s.title cannot be empty at save" % type(self).__name__)
        # if empty, `slug` is set to slugified `title`
        if set_slug and is_empty(self.slug):
            self.slug = slugify(self.title)