<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_queryset(self):
 """ Check if relation_names is correctly set and do a prefetch related on the queryset with it. """

        if self.relation_names is None:
            raise ImproperlyConfigured(
                "'%s' must define 'relation_names'" %
                self.__class__.__name__)
        if not isinstance(self.relation_names, (tuple, list)):
            raise ImproperlyConfigured(
                "%s's relation_names property must be a tuple or list." %
                self.__class__.__name__)
        return super(PrefetchRelatedMixin, self
                     ).get_queryset().prefetch_related(*self.relation_names)