Create an appropriately named folder in which the database is to be stored
        :param databasepath: path to use to save the database
        :param database: the name of the database folder to create
        :return: the absolute path of the folder
5586
def create_database_folder(databasepath, database):
        
        logging.info('Setting up {} database'.format(database))
        # Define the path to store the database files
        databasepath = os.path.join(databasepath, database)
        # Create the path as required
        make_path(databasepath)
        return databasepath
1193262
def newFile(self, *path):
        
        assert len(path) > 0, "newFile requires a nonzero number of segments"
        if self.dbdir is None:
            if self.filesdir is None:
                raise RuntimeError("This in-memory store has no file directory")
            else:
                tmpbase = self.filesdir
        else:
            tmpbase = self.dbdir
        tmpname = tmpbase.child('temp').child(str(tempCounter.next()) + ".tmp")
        return AtomicFile(tmpname.path, self.newFilePath(*path))
1241954
def clark(self, databasepath):
        
        if self.clarkpath:
            logging.info('Downloading CLARK database')
            # Create the folder in which the database is to be stored
            databasepath = self.create_database_folder(databasepath, 'clark')
            # Set the call to create the database - use the --light option, as we don't require the full database
            targetcall = 'cd {clarkpath} && ../opt/clark/set_targets.sh {dbpath} bacteria --species --light'\
                .format(clarkpath=self.clarkpath,
                        dbpath=databasepath)
            # Download the database
            self.database_clone(targetcall, databasepath)
        else:
            logging.warning('No CLARK scripts detected in $PATH. Cannot download database.')
119733
protected File initRecoveryDb(String dbName) {
    Preconditions.checkNotNull(_recoveryPath,
      "recovery path should not be null if NM recovery is enabled");

    File recoveryFile = new File(_recoveryPath.toUri().getPath(), dbName);
    if (recoveryFile.exists()) {
      return recoveryFile;
    }

    // db doesn't exist in recovery path go check local dirs for it
    String[] localDirs = _conf.getTrimmedStrings("yarn.nodemanager.local-dirs");
    for (String dir : localDirs) {
      File f = new File(new Path(dir).toUri().getPath(), dbName);
      if (f.exists()) {
        // If the recovery path is set then either NM recovery is enabled or another recovery
        // DB has been initialized. If NM recovery is enabled and had set the recovery path
        // make sure to move all DBs to the recovery path from the old NM local dirs.
        // If another DB was initialized first just make sure all the DBs are in the same
        // location.
        Path newLoc = new Path(_recoveryPath, dbName);
        Path copyFrom = new Path(f.toURI());
        if (!newLoc.equals(copyFrom)) {
          logger.info("Moving " + copyFrom + " to: " + newLoc);
          try {
            // The move here needs to handle moving non-empty directories across NFS mounts
            FileSystem fs = FileSystem.getLocal(_conf);
            fs.rename(copyFrom, newLoc);
          } catch (Exception e) {
            // Fail to move recovery file to new path, just continue on with new DB location
            logger.error("Failed to move recovery file {} to the path {}",
              dbName, _recoveryPath.toString(), e);
          }
        }
        return new File(newLoc.toUri().getPath());
      }
    }

    return new File(_recoveryPath.toUri().getPath(), dbName);
  }
686625
public @CheckForNull FilePath createPath(String absolutePath) {
        VirtualChannel ch = getChannel();
        if(ch==null)    return null;    // offline
        return new FilePath(ch,absolutePath);
    }
903449
def create_diamond_db(self):
        '''
        '''
        base = self.unaligned_sequence_database_path()
        cmd = "diamond makedb --in '%s' -d '%s'" % (self.unaligned_sequence_database_path(), base)
        extern.run(cmd)
        diamondb = '%s.dmnd' % base
        # Mostly this moves a file to it's current location because Create
        # follows this same logic, but there's a specially crafted
        # test/data/mcrA.gpkg which is slightly different.
        os.rename(diamondb, self.diamond_database_path())
        return diamondb
266320
def default_database(ctx: click.Context, _param: Parameter, value: Optional[str]):
    """"""
    if value:
        return value

    if ctx.params["repository"]:
        return os.path.join(ctx.params["repository"], DB.DEFAULT_DB_FILE)

    raise click.BadParameter("Could not guess a database location")
947742
public boolean create(String strDatabaseName) throws DBException
    {
        try {
            String strDBName = this.getProperty(SQLParams.INTERNAL_DB_NAME);
            int iDatabaseType = DBConstants.SYSTEM_DATABASE;
            DatabaseOwner env = this.getDatabaseOwner();
            JdbcDatabase db = (JdbcDatabase)env.getDatabase(strDBName, iDatabaseType, null);    // Do NOT pass properties when opening system database
            Statement queryStatement = db.getJDBCConnection().createStatement();

            String strSQL = "create database " + strDatabaseName + ";";
            queryStatement.execute(strSQL);
            queryStatement.close();
            db.free();

            String oldValue = this.getProperty(DBConstants.CREATE_DB_IF_NOT_FOUND);
            this.setProperty(DBConstants.CREATE_DB_IF_NOT_FOUND, DBConstants.FALSE);
            
            this.close();   // Since I don't know what kind of connection this is.
            this.setupDBConnection();

            this.setProperty(DBConstants.CREATE_DB_IF_NOT_FOUND, oldValue);
            
            if (this.getProperty(DBConstants.LOAD_INITIAL_DATA) != null)
            	if ((this.getDatabaseType() & (DBConstants.SHARED_DATA | DBConstants.USER_DATA)) == DBConstants.SHARED_DATA)	// Yes, only shared data can have DatabaseInfo
            {
                DatabaseInfo recDatabaseInfo = new DatabaseInfo();
                try {
                	recDatabaseInfo.setDatabaseName(this.getDatabaseName(false));
                	recDatabaseInfo.setTable(this.doMakeTable(recDatabaseInfo));    // This makes a jdbc table
                	recDatabaseInfo.init(null); // This should create the table if an archive exists
                } catch (Exception ex) {
                	// Ignore
                } finally {
                	recDatabaseInfo.free();
                }
            }
            return true;    // Success
        } catch (SQLException ex) {
            ex.printStackTrace();
        }

        return super.create(strDatabaseName);   // Error, not found
    }
227896
def create_database(self):
        
        self.print_message("Creating database '%s'" % self.databases['destination']['name'])
        self.export_pgpassword('destination')
        args = [
            "createdb",
            self.databases['destination']['name'],
        ]
        args.extend(self.databases['destination']['args'])
        for arg in self.databases['destination']['args']:
            if arg[:7] == '--user=':
                args.append('--owner=%s' % arg[7:])
        subprocess.check_call(args)
414380
def univec(self, databasepath):
        
        logging.info('Downloading univec database')
        databasepath = self.create_database_folder(databasepath, 'univec')
        # Set the name of the output file
        outputfile = os.path.join(databasepath, 'UniVec_core.tfa')
        target_url = 'ftp://ftp.ncbi.nlm.nih.gov/pub/UniVec/UniVec_Core'
        self.database_download(output_file=outputfile,
                               target_url=target_url,
                               database_path=databasepath)
        # Create a copy of the file with a .fasta extension
        if os.path.isfile(outputfile):
            renamed = os.path.splitext(outputfile)[0] + '.fasta'
            shutil.copy(outputfile, renamed)
188683
def namedb_create(path, genesis_block):
    

    global BLOCKSTACK_DB_SCRIPT

    if os.path.exists( path ):
        raise Exception("Database '%s' already exists" % path)

    lines = [l + ";" for l in BLOCKSTACK_DB_SCRIPT.split(";")]
    con = sqlite3.connect( path, isolation_level=None, timeout=2**30 )

    for line in lines:
        db_query_execute(con, line, ())

    con.row_factory = namedb_row_factory

    # create genesis block
    namedb_create_token_genesis(con, genesis_block['rows'], genesis_block['history'])
    return con
1239287
def create_database(destroy_existing=False):
    
    if not os.path.exists(DB_NAME):
        logger.info('Create database: {0}'.format(DB_NAME))
        open(DB_NAME, 'a').close()
        Show.create_table()
        Episode.create_table()
        Setting.create_table()
1042261
def create_directory(self, filename):
        """"""
        path = os.path.join(self.path, filename)
        makedirs(path)
        return path
1204791
def create(name, database=None, auto=False, auto_source=False, directory=None, verbose=None):
    """"""
    router = get_router(directory, database, verbose)
    if auto and auto_source:
        auto = auto_source
    router.create(name, auto=auto)
54793
public static Database createHiveDatabase(String dbName, CatalogDatabase db) {
		Map<String, String> props = db.getProperties();
		return new Database(
			dbName,
			db.getDescription().isPresent() ? db.getDescription().get() : null,
			null,
			props);
	}
1091200
def _create_database(self):
        

        self._logger.info('creating user database')
        sql = '''CREATE TABLE IF NOT EXISTS user (
            username NOT NULL PRIMARY KEY,
            pwd_salt NOT NULL,
            pwd_hash NOT NULL,
            full_name,
            trusted NOT NULL DEFAULT 0,
            readonly NOT NULL DEFAULT 0
        )'''
        self._db_curs.execute(sql)
        self._db_conn.commit()
693428
public static String generateDbPath(String baseDir, String dbName) {
    return PathUtils.concatPath(baseDir, dbName);
  }