Returns True is an object belongs to a module.

def belongsToModule(obj, module):
        """Returns True is an object belongs to a module."""
        return obj.__module__ == module.__name__ or obj.__module__.startswith(
            module.__name__)