<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _filter_nonextensions(cls, obj):
 """Remove all classes marked as not extensions. This allows us to have a deeper hierarchy of classes than just one base class that is filtered by _filter_subclasses. Any class can define a class propery named: __NO_EXTENSION__ = True That class will never be returned as an extension. This is useful for masking out base classes for extensions that are declared in CoreTools and would be present in module imports but should not create a second entry point. """


        # Not all objects have __dict__ attributes.  For example, tuples don't.
        # and tuples are used in iotile.build for some entry points.
        if hasattr(obj, '__dict__') and obj.__dict__.get('__NO_EXTENSION__', False) is True:
            return False

        return True