Initialize the communities file bucket.

    :raises: `invenio_files_rest.errors.FilesException`
2092
def initialize_communities_bucket():
    
    bucket_id = UUID(current_app.config['COMMUNITIES_BUCKET_UUID'])

    if Bucket.query.get(bucket_id):
        raise FilesException("Bucket with UUID {} already exists.".format(
            bucket_id))
    else:
        storage_class = current_app.config['FILES_REST_DEFAULT_STORAGE_CLASS']
        location = Location.get_default()
        bucket = Bucket(id=bucket_id,
                        location=location,
                        default_storage_class=storage_class)
        db.session.add(bucket)
        db.session.commit()
1173520
public function initialize()
    {
        if ($this->versionStorage->hasVersioningNode()) {
            throw new MigratorException('This repository has already been initialized. Will not re-initialize.');
        }

        foreach (array_keys($this->versionCollection->getAllVersions()) as $timestamp) {
            $this->versionStorage->add($timestamp);
        }

        $this->session->save();
    }
1170541
public void init()
    throws IOException
  {
    long now = CurrentTime.getExactTime();

    // server/0263
    // _nextRolloverCheckTime = now + _rolloverCheckPeriod;

    Path path = getPath();

    if (path != null) {
      Files.createDirectories(path.getParent());

      _rolloverPrefix = path.getName(path.getNameCount() - 1).toString();

      long lastModified = Files.getLastModifiedTime(path).toMillis();
      
      if (lastModified <= 0 || now < lastModified) {
        lastModified = now;
      }

      // _calendar.setGMTTime(lastModified);

      _nextPeriodEnd = nextRolloverTime(lastModified);
    }
    else {
      _nextPeriodEnd = nextRolloverTime(now);
    }
    
    if (_archiveFormat != null || getRolloverPeriod() <= 0) {
    }
    else if (_rolloverCron != null)
      _archiveFormat = _rolloverPrefix + ".%Y%m%d.%H";
    else if (getRolloverPeriod() % DAY == 0)
      _archiveFormat = _rolloverPrefix + ".%Y%m%d";
    else if (getRolloverPeriod() % HOUR == 0)
      _archiveFormat = _rolloverPrefix + ".%Y%m%d.%H";
    else
      _archiveFormat = _rolloverPrefix + ".%Y%m%d.%H%M";
    
    _isInit = true;

    _rolloverListener.requeue(_rolloverAlarm);
    rollover();
  }
239070
def initialize(self, timestamp=None, user=None, comment=None,
                   filename=None, source=None, size=None):

        self.timestamp = none_or(timestamp, Timestamp)
        

        self.user = none_or(user, User)
        """
        Contributing user metadata : :class:`~mwtypes.User`
        """

        self.comment = none_or(comment, str)
        """
        Comment left with upload : str | None
        """

        self.filename = none_or(filename, str)
        """
        File name without "File:" prefix and "_" instead of spaces : str | None
        """

        self.source = none_or(source, str)
        """
        A URI : str | None
        """

        self.size = none_or(size, int)
        """
        Number of bytes of content : int | None
        """
185710
private void initSchemaPartition() throws Exception {
        final InstanceLayout instanceLayout = this.service.getInstanceLayout();

        final File schemaPartitionDirectory = new File(instanceLayout.getPartitionsDirectory(), "schema");

        /*
         * Extract the schema on disk (a brand new one) and load the registries
         */
        if (schemaPartitionDirectory.exists()) {
            System.out.println("schema partition already exists, skipping schema extraction");
        } else {
            final SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(instanceLayout.getPartitionsDirectory());
            extractor.extractOrCopy();
        }

        final SchemaLoader loader = new LdifSchemaLoader(schemaPartitionDirectory);
        final SchemaManager schemaManager = new DefaultSchemaManager(loader);

        /*
         * We have to load the schema now, otherwise we won't be able
         * to initialize the Partitions, as we won't be able to parse
         * and normalize their suffix Dn
         */
        schemaManager.loadAllEnabled();

        final List<Throwable> errors = schemaManager.getErrors();

        if (errors.size() != 0) {
            throw new Exception(I18n.err(I18n.ERR_317,
                                         Exceptions.printErrors(errors)));
        }

        this.service.setSchemaManager(schemaManager);

        /*
         * Init the LdifPartition with schema
         */
        final LdifPartition schemaLdifPartition = new LdifPartition(schemaManager);
        schemaLdifPartition.setPartitionPath(schemaPartitionDirectory.toURI());

        /*
         * The schema partition
         */
        final SchemaPartition schemaPartition = new SchemaPartition(schemaManager);
        schemaPartition.setWrappedPartition(schemaLdifPartition);
        this.service.setSchemaPartition(schemaPartition);
    }
719987
private void initialize() {

		domainIds.addAll(getResourceIds("rdfs:domain"));
		rangeIds.addAll(getResourceIds("rdfs:range"));

		allowsInstances     = "true".equals(getValue(getFirstElement(getElement(), "krdf:allowsInstances")));
		multipleOccurrences = "true".equals(getValue(getFirstElement(getElement(), "krdf:multipleOccurrences")));
		isMixedIn           = "true".equals(getValue(getFirstElement(getElement(), "krdf:isMixedIn")));
		oneWay              = "true".equals(getValue(getFirstElement(getElement(), "krdf:oneWay")));
		icon                = getValue(getFirstElement(getElement(), "krdf:icon"));

		final Object isPrimaryValue = getValue(getFirstElement(getElement(), "krdf:primary"));
		if (isPrimaryValue == null || "true".equals(isPrimaryValue)) {

			primary = true;
		}


		final Node node = getFirstElement(getElement(), "owl:inverseOf");
		if (node != null) {

			final String inverse = getResourceId(node);
			if (inverse != null) {

				this.inverseId = URI.create(inverse);
			}
		}

	}
99628
def init_file(self, filename, lines, expected, line_offset):
        """"""
        super(_PycodestyleReport, self).init_file(
            filename, lines, expected, line_offset)
        self.errors = []
409753
def initialize(self, host):
        
        self.host = host
        self.storage_client = BlockBlobService(account_name=self.storage_account_name,
                                               account_key=self.storage_account_key,
                                               sas_token=self.storage_sas_token,
                                               endpoint_suffix=self.endpoint_suffix,
                                               connection_string=self.connection_string,
                                               request_session=self.request_session)
        self.consumer_group_directory = self.storage_blob_prefix + self.host.eh_config.consumer_group
816123
def _initFilesystemInfo(self):
        """"""
        self._mapFSpathDev = {}
        fsinfo = FilesystemInfo()
        for fs in fsinfo.getFSlist():
            devpath = fsinfo.getFSdev(fs)
            dev = self._getUniqueDev(devpath)
            if dev is not None:
                self._mapFSpathDev[fs] = dev
303157
private void initSessions() throws FileNotFoundException, ClassNotFoundException, IOException,
        ResourceNotExistingException, TTException {
        Map<String, String> filelisteners = getFilelisteners();
        mSessions = new HashMap<String, ISession>();
        mTrx = new HashMap<String, IFilelistenerWriteTrx>();

        if (filelisteners.isEmpty()) {
            return;
        }

        for (Entry<String, String> e : filelisteners.entrySet()) {
            mSessions.put(e.getKey(), StorageManager.getSession(e.getKey()));
            mTrx.put(e.getKey(), new FilelistenerWriteTrx(mSessions.get(e.getKey()).beginBucketWtx(),
                mSessions.get(e.getKey())));
            mSubDirectories.put(e.getValue(), new ArrayList<String>());
            mExecutorMap.put(e.getValue(), Executors.newSingleThreadExecutor());

            List<String> subDirs = mSubDirectories.get(e.getValue());

            for (String s : mTrx.get(e.getKey()).getFilePaths()) {
                String fullFilePath =
                    new StringBuilder().append(e.getValue()).append(File.separator).append(s).toString();
                subDirs.add(fullFilePath);

                Path p = Paths.get(fullFilePath);

                watchParents(p, e.getValue());
            }
        }
    }
872796
def create_bucket(self, instance, bucket_name):
        
        req = rest_pb2.CreateBucketRequest()
        req.name = bucket_name
        url = '/buckets/{}'.format(instance)
        self._client.post_proto(url, data=req.SerializeToString())
908547
protected function initDefaultFiles()
    {
        $logDir = $this->getParam(DirectoryKeys::VAR_LOG) . DIRECTORY_SEPARATOR;
        $this->setParam(FileKeys::APPSERVER_ERRORS_LOG, ParamNode::TYPE_STRING, $logDir . 'appserver-errors.log');
        $this->setParam(FileKeys::APPSERVER_ACCESS_LOG, ParamNode::TYPE_STRING, $logDir . 'appserver-access.log');
    }
435167
def initialize(self):
        """"""
        if self.collname not in self.current_kv_names():
            r = self.request('post',
                             self.url+"storage/collections/config",
                             headers={'content-type': 'application/json'},
                             data={'name': self.collname})
            r.raise_for_status()
        # initialize schema
        re = self.request('post',
                          self.url+"storage/collections/config/"+self.collname,
                          headers = {'content-type': 'application/json'},
                          data=self.schema)
        re.raise_for_status()
        logger.info("initialized Splunk Key Value Collection %s with schema %s"\
                        % (self.collname, str(self.schema)))
        if self.collname not in self.current_kv_names():
            raise EnvironmentError('expected %s in list of kv collections %s' % (self.collname, str(self.current_kv_names())))
1181852
private function initialize()
    {
        if ($this->initialized) {
            return;
        }

        if ($this->session->isStarted() && $this->session->get('stack') !== null) {
            $paths = $this->session->get('stack');
            $this->files = $this->hydrateList($paths);
        } else {
            $paths = $this->users->getCurrentUser()['stack'];
            $this->files = $this->hydrateList($paths);
            $this->session->set('stack', $this->persistableList());
        }

        $this->initialized = true;
    }
407391
protected final void init() {
        checkState(!initialized, "initialized already");
        Throwable cause = null;
        try {
            final File[] childFiles = rootDir.listFiles();
            if (childFiles != null) {
                for (File f : childFiles) {
                    loadChild(f);
                }
            }
            initialized = true;
        } catch (Throwable t) {
            cause = t;
        }

        if (cause != null) {
            final CentralDogmaException finalCause;
            if (cause instanceof CentralDogmaException) {
                finalCause = (CentralDogmaException) cause;
            } else {
                finalCause = new CentralDogmaException("Failed to load a child: " + cause, cause);
            }
            close(() -> finalCause);
            throw finalCause;
        }
    }
833428
def initialise(self):
        
        self._checkWriteMode()
        self._createSystemTable()
        self._createNetworkTables()
        self._createOntologyTable()
        self._createReferenceSetTable()
        self._createReferenceTable()
        self._createDatasetTable()
        self._createReadGroupSetTable()
        self._createReadGroupTable()
        self._createCallSetTable()
        self._createVariantSetTable()
        self._createVariantAnnotationSetTable()
        self._createFeatureSetTable()
        self._createContinuousSetTable()
        self._createBiosampleTable()
        self._createIndividualTable()
        self._createPhenotypeAssociationSetTable()
        self._createRnaQuantificationSetTable()
1178416
def init(self):
        

        self.credentials = self._get_credentials()
        self.http = self.credentials.authorize(httplib2.Http())
        self.service = discovery.build(
            'sheets',
            'v4',
            http=self.http,
            discoveryServiceUrl=DISCOVERY_URL,
        )