'Install this ImportManager into the specified namespace.'

def install(self, namespace=vars(__builtin__)):

    if isinstance(namespace, _ModuleType):
        namespace = vars(namespace)
    self.previous_importer = namespace['__import__']
    self.namespace = namespace
    namespace['__import__'] = self._import_hook
