Load class instance
187386
def load(yml)
      if yml.nil?
        nbayes = NBayes::Base.new
      elsif yml[0..2] == "---"
        nbayes = self.class.from_yml(yml)
      else
        nbayes = self.class.from(yml)
      end
      nbayes
    end
873638
private Class<?> loadClass(final String classname) throws PluginException {
        if (null == classname) {
            throw new IllegalArgumentException("A null java class name was specified.");
        }
        if (null != classCache.get(classname)) {
            return classCache.get(classname);
        }
        CachedJar cachedJar1 = getCachedJar();

        debug("loadClass! " + classname + ": " + cachedJar1.getCachedJar());
        final Class<?> cls;
        final URLClassLoader urlClassLoader = cachedJar1.getClassLoader();
        try {
            cls = Class.forName(classname, true, urlClassLoader);
            classCache.put(classname, cls);
        } catch (ClassNotFoundException e) {
            throw new PluginException("Class not found: " + classname, e);
        } catch (Throwable t) {
            throw new PluginException("Error loading class: " + classname, t);
        }
        return cls;
    }
34890
Class<?> loadClass(String requestedClass, boolean initialize) throws ClassNotFoundException {
    String binaryName = requestedClass;
    while (true) {
      try {
        return Class.forName(binaryName, initialize, classLoader);
      } catch (ClassNotFoundException e) {
        if (!binaryName.contains(".")) {
          throw e;
        } else {
          binaryName = replaceLastPeriodWithDollar(binaryName);
        }
      }
    }
  }
64532
private ScriptClassLoader loadClassByLoader() throws Exception 
	{
		ScriptClassLoader newClassLoader = new ScriptClassLoader();
		Set<Class<?>> allClass = newClassLoader.findedClass;
		Set<Class<?>> fileClass=new HashSet<>();
		for(DirClassFile dcf:scriptSource.getDirClassFiles())
		{
			File file=new File(dcf.getRootDir().getFile());
			if(!file.exists())
			{
				continue;
			}
			newClassLoader.addURL(dcf.getRootDir());
			for(String className:dcf.getClassNames())
			{
				Class<?> clazz=newClassLoader.loadClass(className);
				if(clazz!=null)
				{
					fileClass.add(clazz);
				}
			}
		}
		Set<Class<?>> urlClass=new HashSet<>();
		for(URLClassFile ucf:scriptSource.getUrlClassFiles())
		{
			newClassLoader.addURL(ucf.getURL());
			Class<?> clazz=newClassLoader.loadClass(ucf.getClassName());
			if(clazz!=null)
			{
				urlClass.add(clazz);
			}
		}
		Set<Class<?>> jarClass=new HashSet<>();
		for(URL jar:scriptSource.getJars())
		{
			JarFile jarFile=null;
			try {
				File file=new File(jar.getFile());
				if(!file.exists())
				{
					continue;
				}
				jarFile=new JarFile(jar.getFile());
				Map<String, JarEntry>  map=FileUtil.findClassByJar(jarFile);
				if(!map.isEmpty())
				{
					newClassLoader.addURL(jar);
					for(String className:map.keySet())
					{
						Class<?> clazz=newClassLoader.loadClass(className);
						if(clazz!=null)
						{
							jarClass.add(clazz);
						}
					}
				}
			} finally {
				if(jarFile!=null)
				{
					jarFile.close();
				}
			}
		}
		allClass.addAll(fileClass);
		allClass.addAll(urlClass);
		allClass.addAll(jarClass);
		_log.debug("classloader init complete,allClass:"+allClass.size()+",fileClass:" + fileClass.size() + ",urlClass:" + urlClass.size() + ",jarClass:" + jarClass.size());
		return newClassLoader;
	}
576864
def register(cls, instance_class, name=None):
        
        if name is None:
            name = instance_class.__name__
        cls.INSTANCE_CLASSES[name] = instance_class
661094
public void loadClass(String className) throws Exception {
        ClassInformation classInfo = classInformation.get(className);

        logger.info("Loading plugin.: {}, {}", className, classInfo.pluginPath);

        // get URL for proxylib
        // need to load this also otherwise the annotations cannot be found later on
        File libFile = new File(proxyLibPath);
        URL libUrl = libFile.toURI().toURL();

        // store the last modified time of the plugin
        File pluginDirectoryFile = new File(classInfo.pluginPath);
        classInfo.lastModified = pluginDirectoryFile.lastModified();

        // load the plugin directory
        URL classURL = new File(classInfo.pluginPath).toURI().toURL();

        URL[] urls = new URL[] {classURL};
        URLClassLoader child = new URLClassLoader(urls, this.getClass().getClassLoader());

        // load the class
        Class<?> cls = child.loadClass(className);

        // put loaded class into classInfo
        classInfo.loadedClass = cls;
        classInfo.loaded = true;

        classInformation.put(className, classInfo);

        logger.info("Loaded plugin: {}, {} method(s)", cls.toString(), cls.getDeclaredMethods().length);
    }
1245639
def load_from_object(self, object_name):
        
        for key in dir(object_name):
            if key.isupper():
                self[key] = getattr(object_name, key)
1194017
<T> Class<T> loadClass(String name) throws ClassNotFoundException {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        if (null == cl) {
            cl = ToHelper.class.getClassLoader();
        }
        return (Class<T>) cl.loadClass(name);
    }
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);
		}
	}
1030774
def instance(cls, *args, **kwargs):
        
        if cls._instance is None:
            cls._instance = cls(*args, **kwargs)
            loaded = cls._instance.reload()
            logging.getLogger('luigi-interface').info('Loaded %r', loaded)

        return cls._instance
103757
def load(self, file=None):
        ""
        if file is None:
            file = self._file
        script_class = self.get_script_class()
        script = self._load(file, self._protocol, self._version)
        return script_class(script)
389281
def load(target, source_module=None):
    """"""
    module, klass, function = _get_module(target)
    if not module and source_module:
        module = source_module
    if not module:
        raise MissingModule(
            "No module name supplied or source_module provided.")
    actual_module = sys.modules[module]
    if not klass:
        return getattr(actual_module, function)

    class_object = getattr(actual_module, klass)
    if function:
        return getattr(class_object, function)
    return class_object
752969
def instantiate(self, cls=None):
        
        if cls is None:
            cls = self.cls
        if cls is None:
            raise TypeError("cls must a class")
        return cls.create(*self.args, **self.kwargs)
1128599
protected final void load()throws Exception
	{
		synchronized (this) {
			Set<Class<?>> classes=classProvider.getLoadedClasses();
			initScriptClasses(classes);
			onScriptLoaded(classes);
		}
	}
818178
@SuppressWarnings("unchecked")
	public static <T> Class<T> loadClass(String className, boolean isInitialized) {
		return (Class<T>) ClassLoaderUtil.loadClass(className, isInitialized);
	}
12983
def loads(cls, s):
        
        with closing(StringIO(s)) as fileobj:
            return cls.load(fileobj)
1039777
public static Class<?> loadClass(String name, boolean init, ClassLoader loader)
    throws ClassNotFoundException
  {
    if (loader == null)
      loader = Thread.currentThread().getContextClassLoader();

    if (loader == null || loader.equals(CauchoUtil.class.getClassLoader()))
      return Class.forName(name);
    else
      return Class.forName(name, init, loader);
  }