Return the plugin name based on the URI
962424
def plugin_name_by_uri(uri):
    ""

    # TODO: parse URIs like 'sqlite://' also
    parsed = urlparse(uri)
    basename = os.path.basename(parsed.path)

    if not basename.strip():
        raise RuntimeError("Could not identify file format.")

    plugin_name = basename.split(".")[-1].lower()
    if plugin_name in FILE_EXTENSIONS:
        plugin_name = MIME_TYPE_TO_PLUGIN_NAME[FILE_EXTENSIONS[plugin_name]]

    return plugin_name
1228940
def find( cls, name ):
        
        if ( cls._plugins is None ):
            cls._plugins = {}
            
        return cls._plugins.get(nativestring(name))
345420
function hasPlugin(deps, pluginName, version) {
    return !!deps.find(function(dep) {
        return dep.getName() === pluginName && (!version || dep.getVersion() === version);
    });
}
801624
def get_name(self, plugin):
        
        for name, val in self._name2plugin.items():
            if plugin == val:
                return name
610876
def plugins(self):
        
        url = self._url('/plugins')
        return self._result(self._get(url), True)
155937
def load_local_plugin(name):
        """"""
        try:
            module_name = '.'.join(name.split('.')[:-1])
            module_obj = importlib.import_module(name=module_name)
            obj = getattr(module_obj, name.split('.')[-1])
            return obj
        except (ImportError, AttributeError, ValueError) as e:
            raise PluginNotFoundError(e)
562750
def load_plugin(self, p):
        
        if p.is_loaded():
            return
        # load required plugins first
        reqnames = p.required
        reqplugins = []
        for name in reqnames:
            try:
                reqplugins.append(self.__plugins[name])
            except KeyError as e:
                log.error("Required Plugin %s not found. Cannot load %s." % (name, p))
                raise errors.PluginInitError('Required Plugin %s not found. Cannot load %s. Reason: %s' % (name, p, e))
        for plug in reqplugins:
            try:
                self.load_plugin(plug)
            except errors.PluginInitError as e:
                log.error("Required Plugin %s could not be loaded. Cannot load %s" % (plug, p))
                raise errors.PluginInitError('Required Plugin %s could not be loaded. Cannot load %s. Reason: %s' % (plug,p, e))
        # load the actual plugin
        p._load()
        log.info('Initialized the plugin: %s' % p)
36323
def uri(self):
        """"""
        CheckParent(self)

        val = _fitz.Link_uri(self)

        if not val:
            val = ""
        else:
            nval = "".join([c for c in val if 32 <= ord(c) <= 127])
            val = nval


        return val
902257
def get_plugins():
    """"""
    if os.path.exists('plugins'):
        for filename in sorted([f for f in os.listdir('plugins')
                if not os.path.isdir(f) and f.endswith(".py")]):
            plugin_name = filename[:-3]
            try:
                plugin = import_plugin(plugin_name)
            except SystemExit as e:
                description = "Plugin has a syntax error"
            else:
                description = plugin.__doc__ or "No description found"
            yield {plugin_name: description}
556093
def get_plugin_info(self, plugin_name):
        """"""
        if plugin_name:
            for i in self.get_all_plugins:
                if i["plugin_name"] == plugin_name:
                    return i
909366
function getName () {
    const pathname = url.parse(parts[parts.length - 1]).pathname;

    return pathname ? pathname.replace('/', '') : pathname;
  }
411166
def uri2module(self, uri):
        """"""
        module_name = uri.replace('.', '&#DOT')
        module_name = module_name.replace(os.sep, '&#SEP')
        return self.module_prefix + module_name
1264157
def get_plugin(name)
      raise "Unknown plugin: #{ name }" unless Capistrano::EXTENSIONS.keys.include?(name)
      self.send(name)
    end
460710
def get_plugin_class(self, plugin_name):
        """"""
        try:
            return self.plugin_classes[plugin_name]
        except KeyError:
            raise RezPluginError("Unrecognised %s plugin: '%s'"
                                 % (self.pretty_type_name, plugin_name))
796634
function get_plugin_name( $premium_suffix = false ) {
            $this->_logger->entrance();

            /**
             * This `if-else` can be squeezed into a single `if` but I intentionally split it for code readability.
             *
             * @author Vova Feldman
             */
            if ( ! isset( $this->_plugin_name ) ) {
                // Name is not yet set.
                $this->set_name( $premium_suffix );
            } else if (
                ! empty( $premium_suffix ) &&
                ( ! is_object( $this->_plugin ) || $this->_plugin->premium_suffix !== $premium_suffix )
            ) {
                // Name is already set, but there's a change in the premium suffix.
                $this->set_name( $premium_suffix );
            }

            return $this->_plugin_name;
        }
1017477
def _organizerPluginName(plugin):
    
    name = getattr(plugin, 'name', None)
    if name is not None:
        return name
    warn(
        "IOrganizerPlugin now has the 'name' attribute"
        " and %s does not define it" % (plugin.__class__,),
        category=PendingDeprecationWarning)
    return _objectToName(plugin).decode('ascii')
499483
def get_plugin_from_string(plugin_name):
    
    modulename, classname = plugin_name.rsplit('.', 1)
    module = import_module(modulename)
    return getattr(module, classname)