Load specified extensions in the order defined by self.extension_include_order.
762650
def extensions!(*extension_syms)
      return extension_syms if extension_syms.length == 0

      extension_syms = extension_syms.flatten.collect {|es| es.to_sym}.compact

      if extension_syms.include?(:all)
        ordered_extension_syms = self.extension_include_order.dup
      else
        extensions_without_defined_order = extension_syms.uniq - self.extension_include_order.uniq
        if extensions_without_defined_order.length > 0
          raise ::Irie::ConfigurationError.new "The following must be added to the self.extension_include_order array in Irie configuration: #{extensions_without_defined_order.collect(&:inspect).join(', ')}"
        else
          ordered_extension_syms = self.extension_include_order & extension_syms
        end
      end

      # load requested extensions
      ordered_extension_syms.each do |arg_sym|
        if module_class_name = self.available_extensions[arg_sym]
          begin
            ::Irie.logger.debug("[Irie] Irie::ClassMethods.extensions! #{self} including #{module_class_name}") if ::Irie.debug?
            include module_class_name.constantize
          rescue NameError => e
            raise ::Irie::ConfigurationError.new "Failed to constantize '#{module_class_name}' with extension key #{arg_sym.inspect} in self.available_extensions. Error: \n#{e.message}\n#{e.backtrace.join("\n")}"
          end      
        else
          raise ::Irie::ConfigurationError.new "#{arg_sym.inspect} isn't defined in self.available_extensions"
        end
      end

      extension_syms
    end
780848
public function loadConfiguration(): void
	{
		$extensions = [];

		// Collect all extensions
		foreach ($this->getConfig() as $name => $extension) {
			if (is_int($name)) {
				$name = null;
			}

			if (is_array($extension)) {
				$extension = array_merge([
					'priority' => 10,
				], $extension);

				if (!array_key_exists('class', $extension)) {
					throw new InvalidStateException(sprintf('Key "class" is required'));
				}

				$extensions[] = [
					'name' => $name,
					'class' => $extension['class'],
					'arguments' => [],
					'priority' => $extension['priority'],
				];
			} elseif ($extension instanceof Statement) {
				$extensions[] = [
					'name' => $name,
					'class' => $extension->getEntity(),
					'arguments' => $extension->arguments,
					'priority' => $extension['priority'],
				];
			} elseif (is_string($extension)) {
				$extensions[] = [
					'name' => $name,
					'class' => $extension,
					'arguments' => [],
					'priority' => 10,
				];
			} else {
				throw new InvalidStateException(
					sprintf(
						'Invalid extension definition "%s" given',
						is_scalar($extension) ? $extension : gettype($extension)
					)
				);
			}
		}

		// Sort all extensions
		usort($extensions, function ($a, $b) {
			if ($a['priority'] === $b['priority']) return 0;

			return $a['priority'] > $b['priority'] ? 1 : -1;
		});

		// Register all extensions
		foreach ($extensions as $extension) {
			$instance = new $extension['class'](...$extension['arguments']);
			$this->compiler->addExtension($extension['name'], $instance);
		}
	}
354439
public function load_extensions() {
		$extensions = [
			new \Frozzare\Digster\Extensions\Filter_Extensions(),
			new \Frozzare\Digster\Extensions\Function_Extensions(),
			new \Frozzare\Digster\Extensions\Global_Extensions(),
			new \Frozzare\Digster\Extensions\I18n_Extensions()
		];

		/**
		 * Modify extensions or add custom.
		 *
		 * @param array $extensions
		 */
		$extensions = apply_filters( 'digster/extensions', $extensions );

		// Register extensions with engine.
		$this->factory->engine()->register_extensions( $extensions );
	}
989235
protected function loadExtensions()
    {
        if ($this->extensionsLoaded) {
            return;
        }
        foreach ($this->extensions as $extension) {
            foreach ($extension->getTags() as $tag) {
                if (!$tag instanceof TagInterface) {
                    throw new Html2PdfException('The ExtensionInterface::getTags() method must return an array of TagInterface.');
                }
                $this->addTagObject($tag);
            }
        }

        $this->extensionsLoaded = true;
    }
275209
def load_imports
      while fn = @pending_imports.shift
        next if @imported.member?(fn)
        if fn_task = lookup(fn)
          fn_task.invoke
        end
        ext = File.extname(fn)
        loader = @loaders[ext] || @default_loader
        loader.load(fn)
        @imported << fn
      end
    end
828268
public void addExtension(Object extension) {
        if (extension == null)
            return;
        if (_extensions == null)
            _extensions = new ArrayList<>();
        _extensions.add(extension);
    }
820125
def parse_extend(self, c, i):
        """"""

        # Start list parsing
        success = True
        index = i.index
        list_type = c
        try:
            c = next(i)
            if c != '(':
                raise StopIteration
            while c != ')':
                c = next(i)

                if self.extend and c in EXT_TYPES and self.parse_extend(c, i):
                    continue

                if c == '\\':
                    try:
                        self._references(i)
                    except StopIteration:
                        pass
                elif c == '[':
                    index = i.index
                    try:
                        self._sequence(i)
                    except StopIteration:
                        i.rewind(i.index - index)

        except StopIteration:
            success = False
            c = list_type
            i.rewind(i.index - index)

        return success
975853
def main(extension, strict_extensions, default_extension, x):
    

    # install a logbook handler before performing any other operations
    logbook.StderrHandler().push_application()
    create_args(x, zipline.extension_args)
    load_extensions(
        default_extension,
        extension,
        strict_extensions,
        os.environ,
    )
433209
def utils(opts, whitelist=None, context=None, proxy=proxy):
    '''
    
    '''
    return LazyLoader(
        _module_dirs(opts, 'utils', ext_type_dirs='utils_dirs'),
        opts,
        tag='utils',
        whitelist=whitelist,
        pack={'__context__': context, '__proxy__': proxy or {}},
    )
416022
def build_extensions(self):
        """"""
        global final_supported_archs

        ext_extra_objects = []
        ext_libs = []
        ext_libs_dir = []
        ext_includes = []

        self.platform = CustomBuildExtension.PLATFORMS.get( sys.platform, None )
        if self.platform == None:
            raise Exception("unsupported platform: %s" % sys.platform)

        if self.with_static_binutils: # the user has specified a custom binutils distro.
            print "[+] Using specific binutils static distribution"
            print "[+]   %s" % self.with_static_binutils
            self.platform["libs"] = [os.path.join( self.with_static_binutils, "lib"),]
            self.platform["includes"] = [os.path.join( self.with_static_binutils, "include"),]
            self.platform["possible-lib-ext"] = [".a",] # for all unix platforms.

        # check for known includes
        for inc in self.platform["includes"]:
            if self.check_includes(inc):
                self.includes = inc # found a valid include dir with bintuils
                break
        if self.includes == None:
            raise Exception("unable to determine correct include path for bfd.h / dis-asm.h")

        print "[+] Using binutils headers at:"
        print "[+]   %s" % self.includes

        # we'll use this include path for building.
        ext_includes = [self.includes, ]

        # Try to guess libopcodes / libbfd libs.
        libs_dirs = self.platform["libs"]
        print "[+] Searching binutils libraries..."
        for libdir in libs_dirs:
            for possible_lib_ext in self.platform["possible-lib-ext"]:
                libs = self.find_binutils_libs(libdir, possible_lib_ext)
                if libs:
                    if self.libs:
                        self.libs = self.libs + libs
                    else:
                        self.libs = libs
                    break

        if self.libs == None:
            raise Exception("unable to find binutils libraries.")

        for lib in self.libs:
            print "[+]   %s" % lib
        #
        # check for libopcodes / libbfd
        #
        libnames = [os.path.basename(lib) for lib in self.libs]
        libraries_paths = [os.path.dirname(lib) for lib in self.libs]
        libraries_paths = list(set(libraries_paths))  # removing duplicates
        if not all( [lib.startswith("libopcodes") or lib.startswith("libbfd") for lib in libnames] ):
            raise Exception("missing expected library (libopcodes / libbfd) in %s." % "\n".join(libraries_paths))

        ext_libs_dir += libraries_paths

        if self.with_static_binutils:
            # use libs as extra objects...
            ext_extra_objects.extend( self.libs )
        else:
            ext_libs = [self.prepare_libs_for_cc(os.path.basename(lib)) for lib in self.libs]

        # add dependecy to libiberty
        if self.with_static_binutils or sys.platform == "darwin": # in OSX we always needs a static lib-iverty.

            lib_liberty_partialpath = libraries_paths
            if sys.platform == "darwin": # in osx the lib-iberty is prefixe by "machine" ppc/i386/x86_64
                lib_liberty_partialpath.append( self._darwin_current_arch() )
            lib_liberty_partialpath.append( "libiberty.a" )

            lib_liberty_fullpath = os.path.join(*lib_liberty_partialpath ) # merge the prefix and the path
            if not os.path.isfile(lib_liberty_fullpath):
                raise Exception("missing expected library (libiberty) in %s." % "\n".join(libraries_paths))
            ext_extra_objects.append(lib_liberty_fullpath)

        # generate .py / .h files that depends of libopcodes / libbfd currently selected
        final_supported_archs = self.generate_source_files()

        # final hacks for OSX
        if sys.platform == "darwin":
            # fix arch value.
            os.environ["ARCHFLAGS"] = "-arch %s" % self._darwin_current_arch()
            # In OSX we've to link against libintl.
            ext_libs.append("intl")

            # TODO: we have to improve the detection of gettext/libintl in OSX.. this is a quick fix.
            dirs = [
                "/usr/local/opt/gettext/lib", # homebrew
                "/opt/local/lib" # macports
            ]
            for d in dirs:
                if os.path.exists(d):
                    ext_libs_dir.append(d)

        # fix extensions.
        for extension in self.extensions:
            extension.include_dirs.extend( ext_includes )
            extension.extra_objects.extend( ext_extra_objects )
            extension.libraries.extend( ext_libs )
            extension.library_dirs.extend( ext_libs_dir )

        return build_ext.build_extensions(self)
742279
def GetLoadingOrder(self):
    """"""
    result = {}
    for filename, mapping in self._file_mapping.iteritems():
      loading_order = mapping['loading_order']
      if loading_order is not None:
        result[loading_order] = filename
    return list(result[key] for key in sorted(result))
1155357
public function load_includes() {

		// Get includes
		$includes = $this->includes;

		// Loop conditions
		foreach ( $includes as $condition => $files ) {

			$do_includes = false;

			// Check condition
			switch( $condition ) {

				// Admin Only
				case 'admin':

					if ( is_admin() ) {
						$do_includes = true;
					}

					break;

				// Frontend Only
				case 'frontend':

					if ( ! is_admin() ) {
						$do_includes = true;
					}

					break;

				// Admin or Frontend (always)
				default:

					$do_includes = true;

					break;

			}

			// Loop files if condition met
			if ( $do_includes ) {

				foreach ( $files as $file ) {
					require_once trailingslashit( CTC_PATH ) . $file;
				}

			}

		}

	}
753354
public function addManagedExtensions()
    {
        if ($this->loaded) {
            throw new \RuntimeException('Extensions already loaded.');
        }

        try {
            $this->extFs->includeFile('vendor/autoload.php');
        } catch (FileNotFoundException $e) {
            $this->loaded = true;

            return;
        }

        $descriptors = $this->loadPackageDescriptors();
        foreach ($descriptors as $descriptor) {
            // Skip loading if marked invalid
            if ($descriptor->isValid() === false) {
                continue;
            }
            $this->addManagedExtension($descriptor);
        }
    }
429764
function (dependencies, extension) {
            if (dependencies) {
                for (var i = dependencies.length - 1; i >= 0; i--) {
                    this.addDependency(dependencies[i], extension);
                }
            }
        }
198950
def load_all(kls):
        """"""
        # Force expansion of contents to lists because we invalidate the iterator
        for region_code, loader in list(kls._region_available.items()):
            if loader is not None:  # pragma no cover
                loader(region_code)
                kls._region_available[region_code] = None
        for country_code, loader in list(kls._country_code_available.items()):
            if loader is not None:
                loader(country_code)
                kls._country_code_available[region_code] = None
309439
def get_extensions(cls):
        
        assemblies = []
        for waldur_extension in pkg_resources.iter_entry_points('waldur_extensions'):
            extension_module = waldur_extension.load()
            if inspect.isclass(extension_module) and issubclass(extension_module, cls):
                if not extension_module.is_assembly():
                    yield extension_module
                else:
                    assemblies.append(extension_module)
        for assembly in assemblies:
            yield assembly
771471
protected function loadExtension($extension)
	{
		if (isset($this->classMap[$extension]))
		{
			return;
		}
		foreach ($this->supportedTypes as $imageType => $extensions)
		{
			if (in_array($extension, $extensions, true))
			{
				$this->loadType($imageType);
			}
		}
	}