Loads the IANA database from the specified file.
765542
private void loadFile(String resourcePath) {
		InputStream stream = getClass().getResourceAsStream(resourcePath);
		if (stream == null) {
			throw new IllegalArgumentException(resourcePath + " is missing");
		}
		BufferedReader lineReader = null;
		try {
			lineReader = new BufferedReader(new InputStreamReader(new GZIPInputStream(stream)));
			stream = null;
			// skip the first line header
			lineReader.readLine();
			while (true) {
				String line = lineReader.readLine();
				if (line == null) {
					break;
				}
				// parse the CSV file. The CSV file contains three elements per row
				String[] parsed = line.split(",");
				if (parsed.length < 3) {
					// ignore invalid entries
					continue;
				}
				String name = parsed[0];
				String mimeType = parsed[1];
				if (mimeType.isEmpty()) {
					continue;
				}
				String reference = parsed[2];
				// fix problem in the CSV file provided by IANA such as G719,audio/G719,"[RFC5404][RFC Errata 3245]"
				if (reference.startsWith("\"")) {
					String nextLine = lineReader.readLine();
					nextLine = nextLine.replaceAll("\\s+", "");
					reference += nextLine;
				}
				IanaEntry ianaEntry = new IanaEntry(name, mimeType, parseReference(reference));
				entryMap.put(mimeType, ianaEntry);
			}
		} catch (IOException ioe) {
			throw new RuntimeException("Error when loading " + resourcePath, ioe);
		} finally {
			closeQuietly(lineReader);
			closeQuietly(stream);
		}
	}
1238570
def loadFile(self, var, close_on_fail = True):
    
    out = None
    try:
      # First see if it is a full path or directly links from the current
      # working directory
      out = np.load(var)
      if self.Verbose: print("Loading "+var+" from numpy binary")
    except:
      try:
        out = np.loadtxt(var)
        if self.Verbose: print("Loading "+var+" ASCII")
      except:
        # Then see if it is relative to the location of the configuration file
        try:
          out = load(self.inpath + var)
          if self.Verbose: print("Loading "+var+" from numpy binary")
        except:
          try:
            out = np.loadtxt(self.inpath + var)
            if self.Verbose: print("Loading "+var+" ASCII")
          # If failure
          except:
            if close_on_fail:
              print("Cannot find "+var+" file")
              print(""+var+" path = " + var)
              print("Looked relative to model python files.")
              print("Also looked relative to configuration file path,")
              print("  ", self.inpath)
              print("Exiting.")
              sys.exit()
            else:
              pass
    return out
80069
def load(self, filething, **kwargs):
        """"""

        fileobj = filething.fileobj

        try:
            self.tags = _IFFID3(fileobj, **kwargs)
        except ID3NoHeaderError:
            self.tags = None
        except ID3Error as e:
            raise error(e)
        else:
            self.tags.filename = self.filename

        fileobj.seek(0, 0)
        self.info = AIFFInfo(fileobj)
704212
private void loadDataFromInternetAndSave() throws IOException {
		InputStream is = null;
		FileOutputStream fos = null;
		try {
			URL url = new URL(DATA_RETRIVE_URL);
			is = url.openStream();
			fos = new FileOutputStream(getCacheFile());
			byte[] buff = new byte[1024 * 8];
			int len = 0;
			while ((len = is.read(buff)) != -1) {
				fos.write(buff, 0, len);
			}
		} finally {
			if (is != null) {
				is.close();
			}
			if (fos != null) {
				fos.close();
			}
		}

	}
560562
def load_schema(ldif_file):
    
    samdb = samdb_connect()
    dn = samdb.domain_dn()

    samdb.transaction_start()
    try:
        setup_add_ldif(samdb, ldif_file, {
            "DOMAINDN": dn,
        })
    except:
        samdb.transaction_cancel()
        raise

    samdb.transaction_commit()
1102380
protected void loadDataFromFile(File definitionFile) throws IOException {
		PHPFileParser fp = new PHPFileParser(definitionFile);
		createInternalDataStructre(fp.getSections());
	}
360494
private void loadHeader(RandomAccessFile fc) throws IOException {
		dbstats.clear();

		ByteBuffer buf = ByteBuffer.allocateDirect(HEADER_SIZE);

		long n = 0;
		int read;
		do {
			read = fc.getChannel().read(buf);
			n += read;
		} while (read > 0); // fill the buffer

		assert n == HEADER_SIZE;

		Check.state(n == HEADER_SIZE, "The file doesn't have a valid OhmDB format!");

		dbstats.put(DbStats.HEADER_SIZE, n);

		buf.rewind();

		String mark = readStr(buf, MARK.length());
		Check.state(mark.equals(MARK), "The file doesn't have a valid OhmDB format (incorrect mark)!");

		int fileVersion = buf.getInt();
		Check.state(fileVersion == 1, "Unsupported OhmDB file format version: %s", fileVersion);

		dbstats.put(DbStats.FILE_VERSION, fileVersion);

		long oddTx1 = buf.getLong();
		long oddTx2 = buf.getLong();
		long oddTx3 = buf.getLong();

		long evenTx1 = buf.getLong();
		long evenTx2 = buf.getLong();
		long evenTx3 = buf.getLong();

		long latestTx = 0;
		if (oddTx1 == oddTx2 && oddTx2 == oddTx3 && oddTx1 > latestTx) {
			latestTx = oddTx1;
			firstTxCounter = false;
		}
		if (evenTx1 == evenTx2 && evenTx2 == evenTx3 && evenTx1 > latestTx) {
			latestTx = evenTx1;
			firstTxCounter = true;
		}

		Long[] commited = { oddTx1, oddTx2, oddTx3, evenTx1, evenTx2, evenTx3 };
		dbstats.put(DbStats.COMMITED, Arrays.asList(commited));

		dbstats.put(DbStats.LATEST_TRANSACTION, latestTx);
		txCounter.set(latestTx);

		// ...

		dbstats.put(DbStats.BLOCK_SIZE, BLOCK_SIZE);

		buf.position(HEADER_SIZE - MARK2.length());
		String mark2 = readStr(buf, MARK2.length());
		Check.state(mark2.equals(MARK2), "The file doesn't have a valid OhmDB format (incorrect mark2)!");
	}
769390
def LoadFile(f, table_name, conn):
  """"""
  reader = csv.reader(f)
  header = next(reader)

  columns = []
  for n in header:
    n = n.replace(' ', '')
    n = n.replace('-', '_')
    columns.append(n)

  create_columns = []
  column_types = {}
  for n in columns:
    if n in column_types:
      create_columns.append("%s %s" % (n, column_types[n]))
    else:
      create_columns.append("%s INTEGER" % (n))

  c = conn.cursor()
  try:
    c.execute("CREATE TABLE %s (%s)" % (table_name, ",".join(create_columns)))
  except sqlite.OperationalError:
    # Likely table exists
    print("table %s already exists?" % (table_name))
    for create_column in create_columns:
      try:
        c.execute("ALTER TABLE %s ADD COLUMN %s" % (table_name, create_column))
      except sqlite.OperationalError:
        # Likely it already exists
        print("column %s already exists in %s?" % (create_column, table_name))

  placeholders = ",".join(["?"] * len(columns))
  insert_values = "INSERT INTO %s (%s) VALUES (%s)" % (table_name, ",".join(columns), placeholders)

  #c.execute("BEGIN TRANSACTION;")
  for row in reader:
    if row:
      if len(row) < len(columns):
        row.extend([None] * (len(columns) - len(row)))
      c.execute(insert_values, row)
  #c.execute("END TRANSACTION;")
  conn.commit()
1182131
def load(self, filename, offset):
        """"""
        try:
            self.offset = offset
            # self.fd = open(filename, 'rb')
            # self.fd.close()
        except IOError:
            self.logger.error('Unable to load EfiSystem volume')
428170
def loadFromFile(self, filename):
        
        if self.__base_url:
            filename = basejoin(self.__base_url,filename)
        file = open(filename, 'rb')
        try:
            schema = self.loadFromStream(file, filename)
        finally:
            file.close()

        return schema
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)
1322962
private void load() throws IOException
    {
        if ( !knownHosts.exists() )
        {
            return;
        }

        assertKnownHostFileReadable();

        try ( BufferedReader reader = new BufferedReader( new FileReader( knownHosts ) ) )
        {
            String line;
            while ( (line = reader.readLine()) != null )
            {
                if ( (!line.trim().startsWith( "#" )) )
                {
                    String[] strings = line.split( " " );
                    if ( strings[0].trim().equals( serverId ) )
                    {
                        // load the certificate
                        fingerprint = strings[1].trim();
                        return;
                    }
                }
            }
        }
    }
1219610
public final void loadPropertiesBase(final String pDirName) throws Exception {
    this.propertiesBase = new PropertiesBase();
    propertiesBase.setDirectory(pDirName);
    this.propertiesBase.setJdbcDriverClass(this.mngSettings
      .getAppSettings().get(PropertiesBase.KEY_JDBC_DRIVER_CLASS));
    this.propertiesBase.setDatabaseName(this.mngSettings
      .getAppSettings().get(PropertiesBase.KEY_DATABASE_NAME));
    this.propertiesBase.setDataSourceClassName(this.mngSettings
      .getAppSettings().get(PropertiesBase.KEY_DATASOURCE_CLASS));
    this.propertiesBase.setUserName(this.mngSettings
      .getAppSettings().get(PropertiesBase.KEY_USER_NAME));
    this.propertiesBase.setUserPassword(this.mngSettings
      .getAppSettings().get(PropertiesBase.KEY_USER_PASSWORD));
    this.propertiesBase.setDatabaseUrl(this.mngSettings
      .getAppSettings().get(PropertiesBase.KEY_DATABASE_URL));
    String currDir = System.getProperty("user.dir");
    if (this.propertiesBase.getDatabaseName() != null
      && this.propertiesBase.getDatabaseName().contains(WORD_CURRENT_DIR)) {
      this.propertiesBase.setDatabaseName(this.propertiesBase.getDatabaseName()
        .replace(WORD_CURRENT_DIR, currDir + File.separator));
    } else if (this.propertiesBase.getDatabaseName() != null
      && this.propertiesBase.getDatabaseName()
        .contains(WORD_CURRENT_PARENT_DIR)) {
      File fcd = new File(currDir);
      this.propertiesBase.setDatabaseName(this.propertiesBase.getDatabaseName()
        .replace(WORD_CURRENT_PARENT_DIR, fcd.getParent() + File.separator));
    }
    if (this.propertiesBase.getDatabaseUrl() != null
      && this.propertiesBase.getDatabaseUrl().contains(WORD_CURRENT_DIR)) {
      this.propertiesBase.setDatabaseUrl(this.propertiesBase.getDatabaseUrl()
        .replace(WORD_CURRENT_DIR, currDir + File.separator));
    } else if (this.propertiesBase.getDatabaseUrl() != null
      && this.propertiesBase.getDatabaseUrl()
        .contains(WORD_CURRENT_PARENT_DIR)) {
      File fcd = new File(currDir);
      this.propertiesBase.setDatabaseUrl(this.propertiesBase.getDatabaseUrl()
        .replace(WORD_CURRENT_PARENT_DIR, fcd.getParent() + File.separator));
    }
  }
917533
def load(path=None, root=None, db=None, load_user=True):
    " "

    config = load_config(path, load_user=load_user)

    remotes = load_remotes(path, load_user=load_user)

    # The external file overwrites the main config
    if remotes:
        if not 'remotes' in config:
            config.remotes = AttrDict()

        for k, v in remotes.remotes.items():
            config.remotes[k] = v

    accounts = load_accounts(path, load_user=load_user)

    # The external file overwrites the main config
    if accounts:
        if not 'accounts' in config:
            config.accounts = AttrDict()
        for k, v in accounts.accounts.items():
            config.accounts[k] = v

    update_config(config)

    if root:
        config.library.filesystem_root = root

    if db:
        config.library.database = db

    return config
701955
def load_from_filename(self, file_name, sep='\n'):
        """"""
        fp = open(file_name, 'rb')
        n = self.load_from_file(fp, sep)
        fp.close()
        return n
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();
        }
    }
1110011
def load(cls, filename, gzipped, byteorder='big'):
        
        open_file = gzip.open if gzipped else open
        with open_file(filename, 'rb') as buff:
            return cls.from_buffer(buff, byteorder)