Check extensions.
18704
def canRender(filename):
        """"""
        name, ext = os.path.splitext(filename)
        ext = ext.lstrip('.').lower()
        if ext in ImageRenderer._extensions:
            return 100
        else:
            return False
65562
def load_extensions_from_config(**config):
    
    extensions = []
    if 'EXTENSIONS' in config:
        for ext in config['EXTENSIONS']:
            try:
                extensions.append(locate(ext))
            except Exception as e:
                print(e)
    return extensions
720559
private function extensionCheck()
    {
        // Check for required PHP extensions
        $required_extensions = ['PDO', 'curl', 'gd', 'json', 'openssl', 'mbstring'];
        $missing = [];
        foreach ($required_extensions as $extension) {
            if (!extension_loaded($extension)) {
                $missing[] = $extension;
            }
        }
        if (count($missing)) {
            asort($missing);
            $this->console->error('Extension required: ' . implode(', ', $missing));
            $this->errors =  true;
        }
    }
1054508
public function checkExtensionsForUpdates()
    {
        $extensions = Symphony::ExtensionManager()->listInstalledHandles();

        if (is_array($extensions) && !empty($extensions)) {
            foreach ($extensions as $name) {
                $about = Symphony::ExtensionManager()->about($name);

                if (array_key_exists('status', $about) && in_array(EXTENSION_REQUIRES_UPDATE, $about['status'])) {
                    $this->Page->pageAlert(
                        __('An extension requires updating.') . ' <a href="' . SYMPHONY_URL . '/system/extensions/">' . __('View extensions') . '</a>'
                    );
                    break;
                }
            }
        }
    }
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)
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
282095
def check(self, diff):
        """"""
        path = diff.b_path
        assert any(
            path.endswith(ext)
            for ext in importlib.machinery.SOURCE_SUFFIXES
        )
112420
def should_ignore(self, filename):
        """"""
        _, ext = os.path.splitext(filename)
        return ext in self.ignored_file_extensions
269718
def get_extensions(self, support=None):
        
        return [x for x in self.extensions.values() if support
                and support in x.supported or not support]
1128202
public function check()
    {
        $extensionName = 'curl';
        $result = extension_loaded($extensionName);

        if ($result === true) {
            $curlVersion = curl_version();
            $this->extensionVersion = $curlVersion['version'];
        }

        return $result;
    }
169085
public List<ExtensionElement> getExtendedInfoAsList() {
        List<ExtensionElement> res = null;
        if (extendedInfo != null) {
            res = new ArrayList<>(1);
            res.add(extendedInfo);
        }
        return res;
    }
511622
def check_extension(cls, ext):
        """"""
        if ext.startswith('.'):
            ext = ext[1:]
        if not any(ext in extension for extension in cls.supported_extensions):
            msg = ("Invalid extension for engine '{engine}': '{ext}'"
                   .format(engine=pprint_thing(cls.engine),
                           ext=pprint_thing(ext)))
            raise ValueError(msg)
        else:
            return True
634360
public boolean isExtension(String name) throws Exception {
        return null != readResource(Address.root().add(EXTENSION, name));
    }
85132
public function extensions()
    {
        foreach ($this->extensionsToCheck as $extension) {
            $extensions[$extension] = extension_loaded($extension);
        }

        return $extensions;
    }
1230428
private void checkAndLoadDependentExtensions() {
        boolean changed = false;
        for (Entry<String, AddOnClassLoader> entry : new HashMap<>(addOnLoaders).entrySet()) {
            AddOn runningAddOn = aoc.getAddOn(entry.getKey());
            if (runningAddOn.getInstallationStatus() == AddOn.InstallationStatus.UNINSTALLATION_FAILED) {
                continue;
            }
            for (String extClassName : runningAddOn.getExtensionsWithDeps()) {
                if (!runningAddOn.isExtensionLoaded(extClassName)) {
                    AddOn.AddOnRunRequirements reqs = runningAddOn.calculateExtensionRunRequirements(
                            extClassName,
                            aoc.getInstalledAddOns());
                    ExtensionRunRequirements extReqs = reqs.getExtensionRequirements().get(0);
                    if (extReqs.isRunnable()) {
                        List<AddOnClassLoader> dependencies = new ArrayList<>(extReqs.getDependencies().size());
                        for (AddOn addOnDep : extReqs.getDependencies()) {
                            dependencies.add(addOnLoaders.get(addOnDep.getId()));
                        }
                        AddOnClassLoader extAddOnClassLoader = new AddOnClassLoader(
                                entry.getValue(),
                                dependencies,
                                runningAddOn.getExtensionAddOnClassnames(extClassName));
                        Extension ext = loadAddOnExtension(runningAddOn, extReqs.getClassname(), extAddOnClassLoader);
                        AddOnInstaller.installAddOnExtension(runningAddOn, ext);
                        runnableAddOns.get(runningAddOn).add(extReqs.getClassname());
                        changed = true;
                    }
                }
            }
        }

        if (changed) {
            saveAddOnsRunState(runnableAddOns);
        }
    }
378704
def __trim_extensions_dot(exts):
  """"""
  if exts is None:
    return None
  res = []
  for i in range(0, len(exts)):
    if exts[i] == "":
      continue
    res.append(__trim_extension_dot(exts[i]))
  return res
695532
private function should_ignore() {
        $parts = explode('.', $this->relative_path);
        $ext = strtolower(end($parts));
        return in_array($ext, $this->should_ignore_extensions);
    }