Load a new instance of the Pattern Loader
549983
public static function init() {
		
		$found = false;
		$patternExtension = Config::getOption("patternExtension");
		self::loadRules();
		
		foreach (self::$rules as $rule) {
			if ($rule->test($patternExtension)) {
				self::$instance = $rule;
				$found = true;
				break;
			}
		}
		
		if (!$found) {
			Console::writeError("the supplied pattern extension didn't match a pattern loader rule. check your config...");
		}
		
	}
157562
def loader_cls(self):
        """"""
        cls = self.app.config['JSONSCHEMAS_LOADER_CLS']
        if isinstance(cls, six.string_types):
            return import_string(cls)
        return cls
357996
def new(cls) -> 'Generator':
        
        logger = logging.getLogger(__name__)
        logger.debug("Generator::new: >>>")

        c_instance = c_void_p()
        do_call(cls.new_handler, byref(c_instance))

        res = cls(c_instance)

        logger.debug("Generator::new: <<< res: %r", res)
        return res
990636
public static Object instance(String clsName,ClassLoader loader)
	{
		try
		{
			return Class.forName(clsName,true,loader).newInstance();
		}
		catch (InstantiationException e)
		{
			throw new RuntimeException(e);
		}
		catch (IllegalAccessException e)
		{
			throw new RuntimeException(e);
		}
		catch (ClassNotFoundException e)
		{
			throw new RuntimeException(e);
		}
	}
507083
def _init_loaders(self) -> None:
        

        for loader in settings.I18N_TRANSLATION_LOADERS:
            loader_class = import_class(loader['loader'])
            instance = loader_class()
            instance.on_update(self.update)
            run(instance.load(**loader['params']))
170645
public static Object tryInstance(String clsName,ClassLoader loader)
	{
		try
		{
			return instance(clsName,loader);
		}
		catch (Exception ex)
		{
			return null;
		}
	}
150726
def load(cls, path, base=None):
        ''''''
        obj = cls()
        obj.read(path, base)
        return obj
132704
function onload() {
    // Create pattern
    pattern = context.createPattern(img, repeat);
    self.setSilent('pattern', pattern); // be a cache
    self.setSilent('patternSource', color);
  }
1315241
public static Object loadInstance(Class clazz, Object[] args, Object defaultValue) {
	if (args == null || args.length == 0) return loadInstance(clazz, defaultValue);
	try {
	    Class[] cArgs = new Class[args.length];
	    for (int i = 0; i < args.length; i++) {
		if (args[i] == null) cArgs[i] = Object.class;
		else cArgs[i] = args[i].getClass();
	    }
	    Constructor c = clazz.getConstructor(cArgs);
	    return c.newInstance(args);

	}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	    return defaultValue;
	}

    }
478132
private void load() {
    Iterator iterator = loaders.iterator();
    while (iterator.hasNext()) {
      MacroLoader loader = (MacroLoader) iterator.next();
      loader.setRepository(this);
      log.debug("Loading from: " + loader.getClass());
      loader.loadPlugins(this);
    }
  }
643403
def loadInstance(self):
        
        if self._loaded:
            return

        self._loaded = True
        module_path = self.modulePath()

        package = projex.packageFromPath(module_path)
        path = os.path.normpath(projex.packageRootPath(module_path))

        if path in sys.path:
            sys.path.remove(path)

        sys.path.insert(0, path)

        try:
            __import__(package)

        except Exception, e:
            err = Plugin(self.name(), self.version())
            err.setError(e)
            err.setFilepath(module_path)

            self._instance = err

            self.setError(e)

            msg = "%s.plugin('%s') errored loading instance from %s"
            opts = (self.proxyClass().__name__, self.name(), module_path)
            logger.warning(msg % opts)
            logger.error(e)
966129
def _load_matcher(self) -> None:
        
        for id_key in self._rule_lst:
            if self._rule_lst[id_key].active:
                pattern_lst = [a_pattern.spacy_token_lst for a_pattern in self._rule_lst[id_key].patterns]

                for spacy_rule_id, spacy_rule in enumerate(itertools.product(*pattern_lst)):
                    self._matcher.add(self._construct_key(id_key, spacy_rule_id), None, list(spacy_rule))
886623
private static Object newInstance(String className,
                                      ClassLoader classLoader)
        throws SOAPException
    {
        try {
            Class spiClass;
            if (classLoader == null) {
                spiClass = Class.forName(className);
            } else {
                spiClass = classLoader.loadClass(className);
            }
            return spiClass.newInstance();
        } catch (ClassNotFoundException x) {
            throw new SOAPException(
                "Provider " + className + " not found", x);
        } catch (Exception x) {
            throw new SOAPException(
                "Provider " + className + " could not be instantiated: " + x,
                x);
        }
    }
1211518
def Pattern(*pattern)
      (self.class)::B._clear_bindings!(caller_locations(1,1)[0].label)
      ::PatternMatching::PatternMatch.new(*pattern)
    end
1050619
def reload(self):
        
        new_model = self.collection.get(self.id)
        self.attrs = new_model.attrs
782822
function Loader(regex) {
    this.cache = Object.create(null);
    this.map = Object.create(null);
    this.requests = 0;
    this.regex = regex;
  }
160703
private void loadFromClasspath() {
        URL url = null;
        try {
            // this is the new location of the file, working on Java 8, Java 9 class path and Java 9 module path
            ClassLoader loader = Thread.currentThread().getContextClassLoader();
            if (loader == null) {
                loader = RenameHandler.class.getClassLoader();
            }
            if (LOG) {
                System.err.println("Loading from classpath: " + loader);
            }
            Enumeration<URL> en = loader.getResources("META-INF/org/joda/convert/Renamed.ini");
            while (en.hasMoreElements()) {
                url = en.nextElement();
                if (LOG) {
                    System.err.println("Loading file: " + url);
                }
                List<String> lines = loadRenameFile(url);
                parseRenameFile(lines, url);
            }
        } catch (Exception ex) {
            if (LOG) {
                ex.printStackTrace(System.err);
            }
            throw new IllegalStateException("Unable to load Renamed.ini: " + url + ": " + ex.getMessage(), ex);
        }
    }