def find_class ( self, aClass ):
        module = self.module
        col    = aClass.rfind( '.' )
        if col >= 0:
            module = aClass[ : col ]
            aClass = aClass[ col + 1: ]

        theClass = getattr( sys.modules.get( module ), aClass, None )
        if (theClass is None) and (col >= 0):
            try:
                mod = __import__( module , globals=globals(), level=1)
                for component in module.split( '.' )[1:]:
                    mod = getattr( mod, component )
                theClass = getattr( mod, aClass, None )
            except:
                pass

        return theClass
dataset/ETHPy150Open enthought/traits/traits/trait_handlers.py/TraitInstance.find_class/original