<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register(self, preference_class):
 """ Store the given preference class in the registry. :param preference_class: a :py:class:`prefs.Preference` subclass """

        preference = preference_class(registry=self)
        self.section_objects[preference.section.name] = preference.section

        try:
            self[preference.section.name][preference.name] = preference

        except KeyError:
            self[preference.section.name] = collections.OrderedDict()
            self[preference.section.name][preference.name] = preference

        return preference_class