<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_extensions(self, data=False):
 """ Yields the extensions or their names Parameters data : boolean, optional If True, returns a generator which yields the extensions. If False, returns a generator which yields the names of the extensions (default) Returns ------- Generator for Extension or string """


        ext_list = [key for key in
                    self.__dict__ if type(self.__dict__[key]) is Extension]
        for key in ext_list:
            if data:
                yield getattr(self, key)
            else:
                yield key