Loads a classifier from the file specified by loadPath. If loadPath ends in
.gz, uses a GZIPInputStream, else uses a regular FileInputStream.
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);
    }
  }
45753
def load(path)
      ptr = CZMQ::FFI::Zconfig.load(path.to_s)
      return from_ffi_delegate(ptr) unless ptr.null?
      CZTop::HasFFIDelegate.raise_zmq_err(
        "error while reading the file %p" % path.to_s)
    end
172057
public static TextClassifier getClassifier(File resourceDirectoryFile)
			throws Exception {
		// check whether we need to unzip the resources first
		if (resourceDirectoryFile.toString().endsWith(".zip")
				&& resourceDirectoryFile.isFile()) {
			resourceDirectoryFile = UnZip.unzip(resourceDirectoryFile);
		}
		// check the existence of the path
		if (resourceDirectoryFile.exists() == false)
			throw new IOException("Directory "
					+ resourceDirectoryFile.getAbsolutePath()
					+ " does not exist");
		// check that the lexicon files exists (e.g. its name should be simply
		// 'lexicon')
		File lexiconFile = new File(resourceDirectoryFile,
				Parameters.lexiconName);
		if (lexiconFile.exists() == false)
			throw new IOException("Lexicon " + lexiconFile + " does not exist");
		// and that there is a model file
		File modelFile = new File(resourceDirectoryFile, Parameters.modelName);
		if (modelFile.exists() == false)
			throw new IOException("Model " + modelFile + " does not exist");
		Lexicon lexicon = new Lexicon(lexiconFile.toString());
		// ask the Lexicon for the classifier to use
		String classifier = lexicon.getClassifierType();
		TextClassifier instance = (TextClassifier) Class.forName(classifier)
				.newInstance();
		// set the last modification info
		instance.lastmodifiedLexicon = lexiconFile.lastModified();
		// set the pathResourceDirectory
		instance.pathResourceDirectory = resourceDirectoryFile
				.getAbsolutePath();
		// set the model
		instance.lexicon = lexicon;
		instance.loadModel();
		return instance;
	}
583335
def loader(filepath, logger=None, **kwargs):
    
    # see ginga.util.loader module
    # TODO: return an AstroTable if loading a table, etc.
    #   for now, assume always an image
    from ginga import AstroImage
    image = AstroImage.AstroImage(logger=logger)

    with asdf.open(filepath) as asdf_f:
        #image.load_asdf(asdf_f, **kwargs)
        image.load_asdf(asdf_f)

    return image
805509
def load_pickle(file_path):
    
    pkl_file = open(file_path, 'rb')
    data = pickle.load(pkl_file)
    pkl_file.close()
    return data
542326
def _load_class(class_path):
    """"""
    parts = class_path.rsplit('.', 1)
    module = __import__(parts[0], fromlist=parts[1])
    return getattr(module, parts[1])
518252
@Override
  public void loadPath(File path, FileFilter filt) {
    FilePathProcessor.processPath(path, filt, this);
  }
987332
def load(self, fileobj):
        ''''''
        # try formats from most restrictive to least restrictive
        for loader in (pickle.load, json.load, csv.reader):
            fileobj.seek(0)
            try:
                return self.initial_update(loader(fileobj))
            except Exception as e:
                pass
        raise ValueError('File not in a supported format')
811492
def load(self, path):
        
        path = os.path.expandvars(os.path.expanduser(path))

        gdg = cgaddag.gdg_load(path.encode("ascii"))
        if not gdg:
            errno = ctypes.c_int.in_dll(ctypes.pythonapi, "errno").value
            raise OSError(errno, os.strerror(errno), path)

        self.__del__()
        self.gdg = gdg.contents
1015512
private static BufferedReader open(final String path) throws IOException {
    if (path.equals("-")) {
      return new BufferedReader(new InputStreamReader(System.in));
    }

    InputStream is = new FileInputStream(path);
    if (path.endsWith(".gz")) {
      is = new GZIPInputStream(is);
    }
    // I <3 Java's IO library.
    return new BufferedReader(new InputStreamReader(is));
  }
399956
async def load(self,
                   file_path,
                   locale=None,
                   key: int = 0,
                   pos: int = 1,
                   neg: Optional[ColRanges] = None):
        

        if neg is None:
            neg: ColRanges = [(2, None)]

        await self.start(file_path, locale, kwargs={
            'key': key,
            'pos': pos,
            'neg': neg,
        })
1093325
public static <L, F> LinearClassifier<L, F> readClassifier(String loadPath) {
    System.err.print("Deserializing classifier from " + loadPath + "...");

    try {
      ObjectInputStream ois = IOUtils.readStreamFromString(loadPath);
      LinearClassifier<L, F> classifier = ErasureUtils.<LinearClassifier<L, F>>uncheckedCast(ois.readObject());
      ois.close();
      return classifier;
    } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException("Deserialization failed: "+e.getMessage());
    }
  }
443335
def from_file(filepath: str):
        
        trace = TrainingTrace()
        trace._trace = load_config(filepath)
        return trace
1262361
public void loadFile(Resource res, String resourcePath) throws IOException {
	res.createFile(true);
	InputStream is = InfoImpl.class.getResourceAsStream(resourcePath);
	IOUtil.copy(is, res, true);
    }
779867
private void loadOptionsFromFile(String filepath){
        try {
            BufferedReader in = new BufferedReader(new FileReader(filepath));

            String stream0 = in.readLine();
            outlierAlgoPanel0.setStreamValueAsCLIString(stream0);

            String algo0 = in.readLine();
            outlierAlgoPanel0.setAlgorithm0ValueAsCLIString(algo0);

            System.out.println("Loading settings from "+filepath);
            logPanel.addText("Loading settings from "+filepath);

        } catch (Exception e) {
            System.out.println("Bad option file:"+e.getMessage());
        }
    }
510533
function loadFile(fullFilePath, callback) {
	fs.readFile(fullFilePath, "utf-8", function(err, data) {
		if (err) {
			return callback(err);
		}

		return callback(null, data);
	});
}
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);
            }
        }
    }