<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _generate_classes(self, class_types, non_defined, **kwargs):
 """ creates the class for each class in the data set args: class_types: list of class_types in the dataset non_defined: list of subjects that have no defined class """

        # kwargs['dataset'] = self
        for class_type in class_types:
            self[class_type[self.smap]] = self._get_rdfclass(class_type,
                                                             **kwargs)\
                                                            (class_type,
                                                             self,
                                                             **kwargs)

            self.add_rmap_item(self[class_type[self.smap]],
                               class_type[self.pmap],
                               class_type[self.omap])

        for class_type in non_defined:
            self[class_type] = RdfClassBase(class_type, self, **kwargs)
            self.add_rmap_item(self[class_type], __a__, None)
        self.__set_classes__
        try:
            self.base_class = self[self.base_uri]
        except KeyError:
            self.base_class = None