Load the given mean and std
@param mean the mean file
@param std the std file
@throws IOException
356188
public void load(File mean, File std) throws IOException {
        this.mean = Nd4j.readBinary(mean);
        this.std = Nd4j.readBinary(std);
    }
1278566
def get_mean_and_std(dataset):
    """"""
    dataloader = torch.utils.data.DataLoader(
        dataset, batch_size=1, shuffle=True, num_workers=2
    )
    mean = torch.zeros(3)
    std = torch.zeros(3)
    print("==> Computing mean and std..")
    for inputs, _ in dataloader:
        for i in range(3):
            mean[i] += inputs[:, i, :, :].mean()
            std[i] += inputs[:, i, :, :].std()
    mean.div_(len(dataset))
    std.div_(len(dataset))
    return mean, std
378089
@Override
	public void load(UnitDaoFactory unitDaoFactory) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream));
		BufferedReaderIterator iterator = new BufferedReaderIterator(reader);

		StringBuilder currentQuery = new StringBuilder();
		while (iterator.hasNext()) {
			String line = iterator.next().trim();

			if (!isCommentOrEmptyLine(line)) {
				currentQuery.append(line).append(" ");
			}

			if (isEndOfQuery(line)) {
				unitDaoFactory.getUnitDao().execute(currentQuery.toString());
				currentQuery = new StringBuilder();
			}
		}
	}
862998
public LoadStatistics getLoadStatistics() throws IOException {
        // TODO: Think about the following handling, cause that has also being
        // done in Computer#details().
        String name;
        if ("master".equals(displayName)) {
            name = "(master)";
        } else {
            name = EncodingUtils.encode(displayName);
        }

        // TODO: ?depth=2 good idea or could this being done better?
        return client.get("/computer/" + name + "/" + "loadStatistics/?depth=2", LoadStatistics.class);
    }
762433
def stdev(x):
    
    """
    from math import sqrt
    n = len(x)
    mean = sum(x) / float(n)
    std = sqrt(sum((a - mean)**2 for a in x) / float(n - 1))
    return std
668811
public void load(File... files) throws IOException {
        setFeatureStats(DistributionStats.load(files[0], files[1]));
        if (isFitLabel()) {
            setLabelStats(DistributionStats.load(files[2], files[3]));
        }
    }
1193345
private void readObject(java.io.ObjectInputStream s)
        throws IOException, ClassNotFoundException
    {
        // Read in the threshold, loadfactor, and any hidden stuff
        s.defaultReadObject();
        
        // Read in number of buckets and allocate the bucket array;
        int numBuckets = s.readInt();
        table = new Entry[numBuckets];
        
        // Read in size (number of Mappings)
        int size = s.readInt();
        
        // Read the keys and values, and put the mappings in the IntHashMap
        for (int i=0; i<size; i++) {
            int key = s.readInt();
            V value = (V) s.readObject();
            put(key, value);
        }
    }
407186
public void load(String modelFile) throws IOException
    {
        if (HanLP.Config.DEBUG)
            logger.start("加载 %s ... ", modelFile);
        ByteArrayStream byteArray = ByteArrayStream.createByteArrayStream(modelFile);
        if (!load(byteArray))
        {
            throw new IOException(String.format("%s 加载失败", modelFile));
        }
        if (HanLP.Config.DEBUG)
            logger.finish(" 加载完毕\n");
    }
461994
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        mean = self._get_mean(sites, rup, dists, imt, stddev_types)
        stddevs = [np.ones(len(dists.rrup))*get_sigma(imt)]
        return mean, stddevs
265671
static public void main(String[] argv) throws IOException,FileNotFoundException
    {
	SoftDictionary m = new SoftDictionary();
	System.out.println("loading...");
	m.loadAliases(new File(argv[0]));
	System.out.println("loaded...");
	for (int i=1; i<argv.length; i++) {
	    System.out.println("lookup: "+argv[i]);
	    String[] f = argv[i].split(":");
	    if (f.length==1) {
		System.out.println(argv[i] +" => "+m.lookup(argv[i])+" at "+m.lookupDistance(argv[i]));
	    } else {
		System.out.println(f[1] +" => "+m.lookup(f[0],f[1])+" at "+m.lookupDistance(f[0],f[1]));
	    }
	}
    }
113788
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        

        sites.vs30 = 600 * np.ones(len(sites.vs30))

        mean, stddevs = super(AkkarBommer2010SWISS01, self).\
            get_mean_and_stddevs(sites, rup, dists, imt, stddev_types)

        tau_ss = 'tau'
        log_phi_ss = np.log(10)
        mean, stddevs = _apply_adjustments(
            AkkarBommer2010.COEFFS, self.COEFFS_FS_ROCK[imt], tau_ss,
            mean, stddevs, sites, rup, dists.rjb, imt, stddev_types,
            log_phi_ss)

        return mean,  np.log(10 ** np.array(stddevs))
1343512
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        C = self.COEFFS[imt]
        mean = (
            self._get_magnitude_term(C, rup.mag) +
            self._get_distance_term(C, rup.mag, dists.rrup) +
            self._get_style_of_faulting_term(C, rup.rake) +
            self._get_site_response_term(C, sites.vs30))

        stddevs = self._get_stddevs(C, stddev_types, len(sites.vs30))
        return mean, stddevs
974289
public void load() throws IOException
    {
        try
        {
            Future<Void> task = loadNB();
            task.get();
        }
        catch (ExecutionException e)
        {
            Throwable t = e.getCause();

            if (t instanceof IOException)
            {
                throw (IOException)t;
            }

            throw new IOException(t);
        }
        catch (InterruptedException e)
        {
            throw new IOException("Loading of the properties file \""
                                        + getFile().getAbsolutePath() + "\" was interrupted.");
        }
    }
69681
public void loadParamFile() throws IOException {
		SeekableLineReaderFactory fact = null;
		SeekableLineReaderIterator iter = null;

		try {
			fact = GeneralURIStreamFactory.createSeekableStreamFactory(
				paramFile, false);
			iter = new SeekableLineReaderIterator(fact.get());

			paramSet = new HashSet<String>();

			while (iter.hasNext()) {
				String param = iter.next();
				param = param.trim();

				if (param.isEmpty() || param.startsWith("#")) {
					continue;
				}

				// Use only the first word, ignore the rest
				int wordEnd = param.indexOf(delim);

				if (wordEnd > 0) {
					param = param.substring(0, wordEnd);
				}

				paramSet.add(param);
			}
		} finally {
			if (iter != null) {
				iter.close();
			}

			if (fact != null) {
				fact.close();
			}
		}
	}
1023800
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        mean = self._get_mean(sites.vs30, rup.mag, dists.rrup, imt, scale_fac=0)
        stddevs = self._get_stddevs(stddev_types, num_sites=sites.vs30.size)

        return mean, stddevs
1023947
@Override
  public void put(Mean other) {
    if(!(other instanceof MeanVariance)) {
      throw new IllegalArgumentException("I cannot combine Mean and MeanVariance to a MeanVariance.");
    }
    final MeanVariance mvo = (MeanVariance) other;
    final double on = mvo.n, osum = mvo.sum;
    final double tmp = n * osum - sum * on;
    final double oldn = n; // tmp copy
    n += on;
    sum += osum;
    m2 += mvo.m2 + tmp * tmp / (on * n * oldn);
  }
168818
public void load(File file) throws IOException {
        _entryFile = file;
        Chronos c = new Chronos();
        ChannelReader in = new ChannelReader(file);

        try {
            in.open();

            // Read entry head
            long fileVersion = in.readLong();
            if (fileVersion != STORAGE_VERSION) {
                throw new RuntimeException("Wrong storage version " + fileVersion + " encounted in " + file.getAbsolutePath() + ". Version " + STORAGE_VERSION
                        + " expected.");
            }

            long minScnHead = in.readLong();
            long maxScnHead = in.readLong();
            int length = in.readInt();

            // Read entry body
            loadDataSection(in, length);

            // Read entry tail
            long minScnTail = in.readLong();
            long maxScnTail = in.readLong();

            if (minScnHead != minScnTail) {
                throw new IOException("min scns don't match: " + minScnHead + " vs " + minScnTail);
            }
            if (maxScnHead != maxScnTail) {
                throw new IOException("max scns don't match:" + maxScnHead + " vs " + maxScnTail);
            }

            _minScn = minScnHead;
            _maxScn = maxScnHead;

            if(_log.isInfoEnabled()) {
                _log.info("loaded entry: minScn=" + _minScn + " maxScn=" + _maxScn + " size=" + size() + " file=" + file.getName() + " in " + c.getElapsedTime());
            }
        } finally {
            in.close();
        }
    }