<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def deftypes(self):
 """generator on all definition of type"""

    for f in self.body:
        if (hasattr(f, '_ctype')
                and (f._ctype._storage == Storages.TYPEDEF
                    or (f._name == '' and isinstance(f._ctype, ComposedType)))):
            yield f