code: def delete_unused(self, keyword_ids=None):
          
          if keyword_ids is None:
              keywords = self.all()
          else:
              keywords = self.filter(id__in=keyword_ids)
          keywords.filter(assignments__isnull=True).delete()
docs: Removes all instances that are not assigned to any object. Limits
          processing to ``keyword_ids`` if given.