load_module

        Attempts to load module by name, if it is not available,
        loads it by url

def load_module(self, module, module_uri=None):
        """load_module

        Attempts to load module by name, if it is not available,
        loads it by url
        """
        # Check to see that module isn't availble in python path
        try:
            import_module(module)
        except ImportError, e:
            if module_uri is None:
                raise e
        else:
            return module

        if not CACHE_DOWNLOADS:
            module_name = self._unique_module_name(module)
        else:
            module_name = self._sanitize_module_name(module)

        # Check to see whether we've already downloaded, otherwise, download
        try:
            import_module(module_name)
        except ImportError:
            module_file = self.download_module(module_uri)
            try:
                load_source(module_name, module_file)
            except Exception:
                msg = "Unable to load code module %s" % module
                self._log.exception(msg)
                raise PIDanticExecutionException(msg)

        return module_name