Loads up the colorization classes from the specified file.
180139
public void setColorizeFile (File path)
    {
        try {
            if (path.getName().endsWith("xml")) {
                ColorPositoryParser parser = new ColorPositoryParser();
                _colRepo = (ColorPository)(parser.parseConfig(path));
            } else {
                _colRepo = ColorPository.loadColorPository(new FileInputStream(path));
            }

            _classList.removeAllItems();
            _classList1.removeAllItems();
            _classList1.addActionListener(new ActionListener() {
                public void actionPerformed (ActionEvent event) {
                    setupColors(_colorList1, (String)_classList1.getSelectedItem());
                }
            });
            _classList2.removeAllItems();
            _classList2.addActionListener(new ActionListener() {
                public void actionPerformed (ActionEvent event) {
                    setupColors(_colorList2, (String)_classList2.getSelectedItem());
                }
            });
            _classList3.removeAllItems();
            _classList3.addActionListener(new ActionListener() {
                public void actionPerformed (ActionEvent event) {
                    setupColors(_colorList3, (String)_classList3.getSelectedItem());
                }
            });
            _classList4.removeAllItems();
            _classList4.addActionListener(new ActionListener() {
                public void actionPerformed (ActionEvent event) {
                    setupColors(_colorList4, (String)_classList4.getSelectedItem());
                }
            });
            Iterator<ColorPository.ClassRecord> iter = _colRepo.enumerateClasses();
            ArrayList<String> names = Lists.newArrayList();
            while (iter.hasNext()) {
                String str = iter.next().name;
                names.add(str);
            }

            _classList1.addItem(NONE);
            _classList2.addItem(NONE);
            _classList3.addItem(NONE);
            _classList4.addItem(NONE);

            Collections.sort(names);
            for (String name : names) {
                _classList.addItem(name);
                _classList1.addItem(name);
                _classList2.addItem(name);
                _classList3.addItem(name);
                _classList4.addItem(name);
            }

            _classList.setSelectedIndex(0);
            _classList1.setSelectedIndex(0);
            _classList2.setSelectedIndex(0);
            _classList3.setSelectedIndex(0);
            _classList4.setSelectedIndex(0);
            _colFilePath.setText(path.getPath());

            CONFIG.setValue(LAST_COLORIZATION_KEY, path.getAbsolutePath());
        }  catch (Exception ex) {
            _status.setText("Error opening colorization file: " + ex);
        }
    }
201955
def load(cls, filename, encoding):
        """"""
        if encoding is None:
            encoding = cls.encoding

        with io.open(filename, 'r', encoding=encoding) as fd:
            source = fd.read()

        if cls.normalize_newlines:
            source = source.replace('\r\n', '\n').replace('\r', '\n')
        return cls.loads(source)
419442
private byte[] loadClassBytes(File classFile) throws IOException
	{

		int size = (int) classFile.length();
		byte buff[] = new byte[size];

		FileInputStream fis = new FileInputStream(classFile);
		DataInputStream dis = null;

		try
		{
			dis = new DataInputStream(fis);
			dis.readFully(buff);
		}
		finally
		{
			if(dis != null)
				dis.close();
		}

		return buff;
	}
604259
protected void loadClasses(Path pluginPath, PluginClassLoader pluginClassLoader) {
        for (String directory : pluginClasspath.getClassesDirectories()) {
            File file = pluginPath.resolve(directory).toFile();
            if (file.exists() && file.isDirectory()) {
                pluginClassLoader.addFile(file);
            }
        }
    }
1147249
private void parsePackageClasses(String name,
            List<JavaFileObject> files,
            ListBuffer<JCCompilationUnit> trees,
            List<String> excludedPackages)
            throws IOException {
        if (excludedPackages.contains(name)) {
            return;
        }

        docenv.notice("main.Loading_source_files_for_package", name);

        if (files == null) {
            Location location = docenv.fileManager.hasLocation(StandardLocation.SOURCE_PATH)
                    ? StandardLocation.SOURCE_PATH : StandardLocation.CLASS_PATH;
            ListBuffer<JavaFileObject> lb = new ListBuffer<JavaFileObject>();
            for (JavaFileObject fo: docenv.fileManager.list(
                    location, name, EnumSet.of(JavaFileObject.Kind.SOURCE), false)) {
                String binaryName = docenv.fileManager.inferBinaryName(location, fo);
                String simpleName = getSimpleName(binaryName);
                if (isValidClassName(simpleName)) {
                    lb.append(fo);
                }
            }
            files = lb.toList();
        }
        if (files.nonEmpty()) {
            for (JavaFileObject fo : files) {
                parse(fo, trees, false);
            }
        } else {
            messager.warning(Messager.NOPOS, "main.no_source_files_for_package",
                             name.replace(File.separatorChar, '.'));
        }
    }
1174525
public Classifier<String, String> loadFromFilename(String file) {
    try {
      File tgtFile = new File(file);
      BufferedReader in = new BufferedReader(new FileReader(tgtFile));

      // Format: read indicies first, weights, then thresholds
      Index<String> labelIndex = HashIndex.loadFromReader(in);
      Index<String> featureIndex = HashIndex.loadFromReader(in);
      double[][] weights = new double[featureIndex.size()][labelIndex.size()];
      String line = in.readLine();
      int currLine = 1;
      while (line != null && line.length()>0) {
        String[] tuples = line.split(LinearClassifier.TEXT_SERIALIZATION_DELIMITER);
        if (tuples.length != 3) {
            throw new Exception("Error: incorrect number of tokens in weight specifier, line="
            +currLine+" in file "+tgtFile.getAbsolutePath());
        }
        currLine++;
        int feature = Integer.valueOf(tuples[0]);
        int label = Integer.valueOf(tuples[1]);
        double value = Double.valueOf(tuples[2]);
        weights[feature][label] = value;
        line = in.readLine();
      }

      // First line in thresholds is the number of thresholds
      int numThresholds = Integer.valueOf(in.readLine());
      double[] thresholds = new double[numThresholds];
      int curr = 0;
      while ((line = in.readLine()) != null) {
        double tval = Double.valueOf(line.trim());
        thresholds[curr++] = tval;
      }
      in.close();
      LinearClassifier<String, String> classifier = new LinearClassifier<String, String>(weights, featureIndex, labelIndex);
      return classifier;
    } catch (Exception e) {
      System.err.println("Error in LinearClassifierFactory, loading from file="+file);
      e.printStackTrace();
      return null;
    }
  }
1174799
public void load( File file )
            throws NumberFormatException, FileNotFoundException, IOException
    {
        loadWords(config, this, file, synBuffer);
    }
1079831
def load(cls, file_path):
        

        # convert back to numpy
        data = helper.read_json(file_path)
        return Concise.from_dict(data)
941252
def load_file(self, filename):
        """"""

        self.counter.clear()
        # python2 issues
        try:
            etree = ET.parse(filename)
        except ET.ParseError:
            parser = ET.XMLParser(encoding='UTF-8')
            etree = ET.parse(filename, parser)
        eroot = etree.getroot()

        self.remove_all()
        self.previewer.remove_all()
        self.widget_editor.hide_all()

        self.previewer.resource_paths.append(os.path.dirname(filename))
        for element in eroot:
            self.populate_tree('', eroot, element,from_file=True)
        children = self.treeview.get_children('')
        for child in children:
            self.draw_widget(child)
        self.previewer.show_selected(None, None)
16359
public void loadFile(File file)
   {
      InputStream is = null;

      try
      {
         is = new FileInputStream(file);
         POIFSFileSystem fs = new POIFSFileSystem(is);
         m_model.setFile(fs);
      }

      catch (IOException ex)
      {
         throw new RuntimeException(ex);
      }

      finally
      {
         StreamHelper.closeQuietly(is);
      }
   }
214996
protected void processClass (File source)
    {
        CtClass clazz;
        InputStream in = null;
        try {
            clazz = _pool.makeClass(in = new BufferedInputStream(new FileInputStream(source)));
        } catch (IOException ioe) {
            System.err.println("Failed to load " + source + ": " + ioe);
            return;
        } finally {
            StreamUtil.close(in);
        }

        try {
            if (clazz.subtypeOf(_streamable)) {
                processStreamable(source, clazz);
            }
        } catch (NotFoundException nfe) {
            System.err.println("Error processing class [class=" + clazz.getName() +
                               ", error=" + nfe + "].");
        }
    }
1306701
def load(filename, loader=None, implicit_tuple=True, env={}, schema=None):
  """"""
  with open(filename, 'r') as f:
    return loads(f.read(),
                 filename=filename,
                 loader=loader,
                 implicit_tuple=implicit_tuple,
                 env=env,
                 schema=schema)
1300389
public static void load(String originalName, ClassLoader loader) {
        // Adjust expected name to support shading of native libraries.
        String packagePrefix = calculatePackagePrefix().replace('.', '_');
        String name = packagePrefix + originalName;
        List<Throwable> suppressed = new ArrayList<Throwable>();
        try {
            // first try to load from java.library.path
            loadLibrary(loader, name, false);
            return;
        } catch (Throwable ex) {
            suppressed.add(ex);
            logger.debug(
                    "{} cannot be loaded from java.library.path, "
                    + "now trying export to -Dio.netty.native.workdir: {}", name, WORKDIR, ex);
        }

        String libname = System.mapLibraryName(name);
        String path = NATIVE_RESOURCE_HOME + libname;

        InputStream in = null;
        OutputStream out = null;
        File tmpFile = null;
        URL url;
        if (loader == null) {
            url = ClassLoader.getSystemResource(path);
        } else {
            url = loader.getResource(path);
        }
        try {
            if (url == null) {
                if (PlatformDependent.isOsx()) {
                    String fileName = path.endsWith(".jnilib") ? NATIVE_RESOURCE_HOME + "lib" + name + ".dynlib" :
                            NATIVE_RESOURCE_HOME + "lib" + name + ".jnilib";
                    if (loader == null) {
                        url = ClassLoader.getSystemResource(fileName);
                    } else {
                        url = loader.getResource(fileName);
                    }
                    if (url == null) {
                        FileNotFoundException fnf = new FileNotFoundException(fileName);
                        ThrowableUtil.addSuppressedAndClear(fnf, suppressed);
                        throw fnf;
                    }
                } else {
                    FileNotFoundException fnf = new FileNotFoundException(path);
                    ThrowableUtil.addSuppressedAndClear(fnf, suppressed);
                    throw fnf;
                }
            }

            int index = libname.lastIndexOf('.');
            String prefix = libname.substring(0, index);
            String suffix = libname.substring(index, libname.length());

            tmpFile = File.createTempFile(prefix, suffix, WORKDIR);
            in = url.openStream();
            out = new FileOutputStream(tmpFile);

            if (shouldShadedLibraryIdBePatched(packagePrefix)) {
                patchShadedLibraryId(in, out, originalName, name);
            } else {
                byte[] buffer = new byte[8192];
                int length;
                while ((length = in.read(buffer)) > 0) {
                    out.write(buffer, 0, length);
                }
            }

            out.flush();

            // Close the output stream before loading the unpacked library,
            // because otherwise Windows will refuse to load it when it's in use by other process.
            closeQuietly(out);
            out = null;
            loadLibrary(loader, tmpFile.getPath(), true);
        } catch (UnsatisfiedLinkError e) {
            try {
                if (tmpFile != null && tmpFile.isFile() && tmpFile.canRead() &&
                    !NoexecVolumeDetector.canExecuteExecutable(tmpFile)) {
                    // Pass "io.netty.native.workdir" as an argument to allow shading tools to see
                    // the string. Since this is printed out to users to tell them what to do next,
                    // we want the value to be correct even when shading.
                    logger.info("{} exists but cannot be executed even when execute permissions set; " +
                                "check volume for \"noexec\" flag; use -D{}=[path] " +
                                "to set native working directory separately.",
                                tmpFile.getPath(), "io.netty.native.workdir");
                }
            } catch (Throwable t) {
                suppressed.add(t);
                logger.debug("Error checking if {} is on a file store mounted with noexec", tmpFile, t);
            }
            // Re-throw to fail the load
            ThrowableUtil.addSuppressedAndClear(e, suppressed);
            throw e;
        } catch (Exception e) {
            UnsatisfiedLinkError ule = new UnsatisfiedLinkError("could not load a native library: " + name);
            ule.initCause(e);
            ThrowableUtil.addSuppressedAndClear(ule, suppressed);
            throw ule;
        } finally {
            closeQuietly(in);
            closeQuietly(out);
            // After we load the library it is safe to delete the file.
            // We delete the file immediately to free up resources as soon as possible,
            // and if this fails fallback to deleting on JVM exit.
            if (tmpFile != null && (!DELETE_NATIVE_LIB_AFTER_LOADING || !tmpFile.delete())) {
                tmpFile.deleteOnExit();
            }
        }
    }
999433
def from_file(cls, filename, source):
        
        _logger.info('Loading theme %s', filename)

        try:
            config = configparser.ConfigParser()
            config.optionxform = six.text_type  # Preserve case
            with codecs.open(filename, encoding='utf-8') as fp:
                config.readfp(fp)
        except configparser.ParsingError as e:
            raise ConfigError(e.message)

        if not config.has_section('theme'):
            raise ConfigError(
                'Error loading {0}:\n'
                '    missing [theme] section'.format(filename))

        theme_name = os.path.basename(filename)
        theme_name, _ = os.path.splitext(theme_name)

        elements = {}
        for element, line in config.items('theme'):
            if element not in cls.DEFAULT_ELEMENTS:
                # Could happen if using a new config with an older version
                # of the software
                _logger.info('Skipping element %s', element)
                continue
            elements[element] = cls._parse_line(element, line, filename)

        return cls(name=theme_name, source=source, elements=elements)
513814
public void loadClassifier(String loadPath, Properties props) throws ClassCastException, IOException, ClassNotFoundException {
    InputStream is;
    // ms, 10-04-2010: check first is this path exists in our CLASSPATH. This
    // takes priority over the file system.
    if ((is = loadStreamFromClasspath(loadPath)) != null) {
      Timing.startDoing("Loading classifier from " + loadPath);
      loadClassifier(is);
      is.close();
      Timing.endDoing();
    } else {
      loadClassifier(new File(loadPath), props);
    }
  }
519877
def load(self, filename='classifier.dump'):
        
        ifile = open(filename, 'r+')
        self.classifier = pickle.load(ifile)
        ifile.close()
133115
public void loadFile(File file, String resourcePath) throws IOException {
	loadFile(ResourceUtil.toResource(file), resourcePath);
    }