Create and optionally open all shared resources.
965773
def _prepare_resources(self, variables, overrides=None):
        """"""

        if overrides is None:
            overrides = {}

        res_map = {}
        own_map = {}

        for decl in self.resources.values():
            resource = overrides.get(decl.name)

            if resource is None:
                args = _complete_parameters(decl.args, variables)
                resource = decl.type(args)
                own_map[decl.name] = resource

            if decl.autocreate:
                resource.open()

            res_map[decl.name] = resource

        return res_map, own_map
28388
def createFileList(self):
        """"""
        global childFileListDownload
        if childFileListDownload is None or not childFileListDownload.is_alive():
            childFileListDownload = multiprocessing.Process(target=self.createFileListHTTP)
            childFileListDownload.start()
1333900
void open() {

        initParams();

        int state = properties.getDBModified();

        switch (state) {

            case HsqlDatabaseProperties.FILES_MODIFIED :
                deleteNewAndOldFiles();
                restoreBackup();
                processScript();
                processDataFile();
                processLog();
                close(false);

                if (cache != null) {
                    cache.open(filesReadOnly);
                }

                reopenAllTextCaches();
                break;

            case HsqlDatabaseProperties.FILES_NEW :
                try {
                    deleteBackup();
                    backupData();
                    renameNewBackup();
                    renameNewScript();
                    deleteLog();
                    properties.setDBModified(
                        HsqlDatabaseProperties.FILES_NOT_MODIFIED);
                } catch (IOException e) {
                    database.logger.appLog.logContext(e, null);
                }

            // continue as non-modified files
            // $FALL-THROUGH$
            case HsqlDatabaseProperties.FILES_NOT_MODIFIED :

                /**
                 * if startup is after a SHUTDOWN SCRIPT and there are CACHED
                 * or TEXT tables, perform a checkpoint so that the .script
                 * file no longer contains CACHED or TEXT table rows.
                 */
                processScript();

                if (isAnyCacheModified()) {
                    properties.setDBModified(
                        HsqlDatabaseProperties.FILES_MODIFIED);
                    close(false);

                    if (cache != null) {
                        cache.open(filesReadOnly);
                    }

                    reopenAllTextCaches();
                }
                break;
        }

        openLog();

        if (!filesReadOnly) {
            properties.setDBModified(HsqlDatabaseProperties.FILES_MODIFIED);
        }
    }
852785
def install_resources
      FileUtils.mkdir_p(resources_dir)

      installed_resources = []
      resources.each do |file|
        begin
          dst = resources_dir + file.basename
          if file.exist? && !dst.exist?
            FileUtils.cp_r(file, resources_dir)
            installed_resources << dst
          end
        rescue ArgumentError => exc
          unless exc.message =~ /same file/
            raise
          end
        end
      end

      installed_resources
    end
280395
def create_all(self, checkfirst: bool = True) -> None:
        
        self.base.metadata.create_all(bind=self.engine, checkfirst=checkfirst)
96745
def build(self, input_path, output_paths):
        """"""
        for output in output_paths:
            shutil.copy(input_path, output_paths)
1086371
def load_sources(self, sources):
        """"""

        self.clear()
        for s in sources:

            if isinstance(s, dict):
                s = Model.create_from_dict(s)

            self.load_source(s, build_index=False)
        self._build_src_index()
943994
def build(self, root="runs"):
        

        for d, control in self.iter(root):
            _mkdirs(d)
            with open(os.path.join(d, self.control_name), 'w') as fp:
                json.dump(control, fp, indent=self.indent)
                # RJSON and some other tools like a trailing newline
                fp.write('\n')
9052
def _create(self):
    """"""
    from .tools import makedirs_safe

    # create directory for sql database
    makedirs_safe(os.path.dirname(self._database))

    # create all the tables
    Base.metadata.create_all(self._engine)
    logger.debug("Created new empty database '%s'" % self._database)
1371782
@Override
	void releaseAllResources() throws IOException {
		if (isReleased.compareAndSet(false, true)) {

			// Gather all exclusive buffers and recycle them to global pool in batch, because
			// we do not want to trigger redistribution of buffers after each recycle.
			final List<MemorySegment> exclusiveRecyclingSegments = new ArrayList<>();

			synchronized (receivedBuffers) {
				Buffer buffer;
				while ((buffer = receivedBuffers.poll()) != null) {
					if (buffer.getRecycler() == this) {
						exclusiveRecyclingSegments.add(buffer.getMemorySegment());
					} else {
						buffer.recycleBuffer();
					}
				}
			}
			synchronized (bufferQueue) {
				bufferQueue.releaseAll(exclusiveRecyclingSegments);
			}

			if (exclusiveRecyclingSegments.size() > 0) {
				inputGate.returnExclusiveSegments(exclusiveRecyclingSegments);
			}

			// The released flag has to be set before closing the connection to ensure that
			// buffers received concurrently with closing are properly recycled.
			if (partitionRequestClient != null) {
				partitionRequestClient.close(this);
			} else {
				connectionManager.closeOpenChannelConnections(connectionId);
			}
		}
	}
1087616
def create(self):
        """"""
        self.buffer = []
        self.buf_count = 0
        if not self.directory.exists: self.directory.create()
        self.open('w')
        return self
313068
function createResource (req) {
  let resource = new Resource(req.path);

  if (!_.isEmpty(req.files)) {
    // Save file data too
    resource.data = _.extend({}, req.body, req.files);
  }
  else {
    resource.data = req.body;
  }

  return resource;
}
124261
def load_all(self):
        '''
        
        '''
        # check for custom conf file before loading conf
        self._load_command_line(conf_only=True)
        self._load_config_file()
        self._load_env()
        self._load_command_line()
        self._imply_options()
        self._validate_options()
        return self
1353157
def create_files(filedef, cleanup=True):
    
    cwd = os.getcwd()
    tmpdir = tempfile.mkdtemp()
    try:
        Filemaker(tmpdir, filedef)
        if not cleanup:  # pragma: nocover
            pass
            # print("TMPDIR =", tmpdir)
        os.chdir(tmpdir)
        yield tmpdir
    finally:
        os.chdir(cwd)
        if cleanup:  # pragma: nocover
            shutil.rmtree(tmpdir, ignore_errors=True)
1025703
def build(self, sources=None, headers=None):
        ''' 
        '''
        tempdir = None
        strings, files = separate_sources(sources)
        if len(strings) or headers:
            # TODO: remove tempdir
            tempdir = tmpdir()

        temp_list = [tmpfile(x, tempdir, '.c') for x in strings]

        if headers:
            for n, s in headers.items():
                (Path(tempdir) / n).write_text(s)

        cmd = self.command_list(files + temp_list)
        if tempdir:
            cmd += ['-I' + tempdir]
        self.proc = Proc(cmd).call()
#        for x in temp_list:
#            os.remove(x)

        if not self.ok:
            raise AvrGccCompileError(cmd, sources, self.error_text)
511986
def open(self, directory=None, filename=None, mode="rb"):
        """"""
        path = os.path.join(directory, filename)
        return open(path, mode)
1365644
@Pure
	protected Resource createResource(ResourceSet  resourceSet) {
		URI uri = computeUnusedUri(resourceSet);
		Resource resource = getResourceFactory().createResource(uri);
		resourceSet.getResources().add(resource);
		return resource;
	}