Discover available extensions.
428885
def discover_extensions(self):
        """"""
        if self._discovery_done:
            return

        try:
            previous_state = self._extensions.copy()

            for app_config in apps.get_app_configs():
                indexes_path = '{}.extensions'.format(app_config.name)
                try:
                    import_module(indexes_path)
                except ImportError:
                    pass

            self._discovery_done = True
        except Exception:
            # Rollback state to prevent corrupted state on exceptions during import.
            self._extensions = previous_state
            raise
17819
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return AvailableAddOnExtensionInstance(
            self._version,
            payload,
            available_add_on_sid=self._solution['available_add_on_sid'],
            sid=self._solution['sid'],
        )
1332620
def _get_available_extensions():
    
    extensions = []

    # from filenames
    parsers_dir = os.path.join(os.path.dirname(__file__))
    glob_filename = os.path.join(parsers_dir, "*" + _FILENAME_SUFFIX + ".py")
    ext_re = re.compile(glob_filename.replace('*', "(?P<ext>\w+)"))
    for filename in glob.glob(glob_filename):
        ext_match = ext_re.match(filename)
        ext = ext_match.groups()[0]
        extensions.append(ext)
        extensions.append('.' + ext)

    # from relevant synonyms (don't use the '' synonym)
    for ext in EXTENSION_SYNONYMS.keys():
        if ext:
            extensions.append(ext)
            extensions.append(ext.replace('.', '', 1))
    extensions.sort()
    return extensions
307530
public function getExtensionsInfoList()
    {
        $data = json_decode(
            $this->getRemoteContents($this->extensionsInfofoUrl)
        );

        $content = $data->encoding === 'base64' ? base64_decode($data->content) : [];
        return json_decode($content, true);// true to array
    }
908478
def load_extensions(environment, extensions):
    
    result = {}
    for extension in extensions:
        if isinstance(extension, basestring):
            extension = import_string(extension)
        result[extension.identifier] = extension(environment)
    return result
996870
def installed(self, app=None):
        """"""
        if app is None:
            app = current_app
        return self.__EXTENSION_NAME in app.extensions
381817
def get_extension_classes():
    
    res = [SyntaxHighlightingExtension, SearchExtension, TagExtension,
           DevhelpExtension, LicenseExtension, GitUploadExtension,
           EditOnGitHubExtension]

    if sys.version_info[1] >= 5:
        res += [DBusExtension]

    try:
        from hotdoc.extensions.c.c_extension import CExtension
        res += [CExtension]
    except ImportError:
        pass

    try:
        from hotdoc.extensions.gi.gi_extension import GIExtension
        res += [GIExtension]
    except ImportError:
        pass

    return res
347714
def get_supports(self):
        
        out = set()
        for ext in self.extensions.values():
            out.update(ext.get_supports())
        return out
763241
public static function discoverAll()
    {
        $components = [];

        // Run through all extensions
        foreach (ExtensionManagementUtility::getLoadedExtensionListArray() as $extensionKey) {
            $components = array_merge($components, self::discoverExtensionComponents($extensionKey));
        }

        return $components;
    }
1287239
def build_extensions (self):
        """"""
        # For gcc >= 3 we can add -std=gnu99 to get rid of warnings.
        extra = []
        if self.compiler.compiler_type == 'unix':
            option = "-std=gnu99"
            if cc_supports_option(self.compiler.compiler, option):
                extra.append(option)
        # First, sanity-check the 'extensions' list
        self.check_extensions_list(self.extensions)
        for ext in self.extensions:
            for opt in extra:
                if opt not in ext.extra_compile_args:
                    ext.extra_compile_args.append(opt)
            self.build_extension(ext)
277602
def extension_by_source(source, mime_type):
    ""

    # TODO: should get this information from the plugin
    extension = source.plugin_name
    if extension:
        return extension

    if mime_type:
        return mime_type.split("/")[-1]
742908
def check_extensions(extensions: Set[str], allow_multifile: bool = False):
    
    check_var(extensions, var_types=set, var_name='extensions')

    # -- check them one by one
    for ext in extensions:
        check_extension(ext, allow_multifile=allow_multifile)
918543
protected function getExtensions() {
        if (!$this->_extensions) {
            $this->_extensions = new AvailableAddOnExtensionList($this->version, $this->solution['sid']);
        }

        return $this->_extensions;
    }
266219
def list_extensions():
    '''
    

    '''
    import nnabla_ext.cpu
    from os.path import dirname, join, realpath
    from os import listdir
    ext_dir = realpath((join(dirname(nnabla_ext.cpu.__file__), '..')))
    return listdir(ext_dir)
992610
function (dirs, done) {
    var self = this;
    utils.findExtensions(dirs, function (err, extensions) {
      if (err) return done(err);

      for (var i = 0; i < extensions.length; i++) {
        extensions[i].type = extensions[i].type || 'basic';
        extensions[i].id = extensions[i].id.toLowerCase();
        if (RESERVED.indexOf(extensions[i].id) !== -1) {
          return done(new Error('Extension id "' + extensions[i].id + '" is reserved. Your plugins are misconfigured.'));
        }
        if (self.ids[extensions[i].id]) {
          // XXX should we die hard, ignore, or warn?
          return done(new Error('Duplicate extension id! Your plugins are misconfigured.'));
        }
        self.ids[extensions[i].id] = true;
        self.extensions[extensions[i].type][extensions[i].id] = extensions[i];
      }
      done();
    });
  }
835291
@RequestMapping(value = "", method = RequestMethod.GET)
    public Resource<ExtensionList> getExtensions() {
        return Resource.of(
                extensionManager.getExtensionList(),
                uri(MvcUriComponentsBuilder.on(getClass()).getExtensions())
        );
    }
770807
def extension(names):
    """"""
    for name in names:
        if not NAME_PATTERN.match(name):
            raise ValueError('invalid extension name: %s' % name)
    def decorator(f, names=names):
        return Extension(f, names=names)
    return decorator