Initialize the current profile, and create necessary files and dirs if not exists. Initialize properties of current profile
496157
function(name) {
    this.profile = trait(Object.create(this.schema), {
      context: this.context
    });

    var profile_dir = this.profile_dir = node_path.join(this.path, name);

    if (!fs.isDir(profile_dir)) {
      fs.mkdir(profile_dir);
    }

    var profile_file = this.profile_file = node_path.join(profile_dir, 'config');

    if (!fs.isFile(profile_file)) {
      fs.write(profile_file, '');

    } else {
      this.reload();
    }
  }
213174
private void init() {
        curDirectory = new File(Environment.getExternalStorageDirectory().getPath());
        currentFile = new File(curDirectory.getPath());
        lastDirectory = curDirectory.getParentFile();

        if (curDirectory.isDirectory()) {
            new UpdateFilesTask(this).execute(curDirectory);
        } else {
            try {
                throw new Exception(getString(R.string.file_picker_directory_error));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
9635
protected function initEnvironment(): void
    {
        $envFile = $this->getRootRelatedPath($this->getEnvFileName());

        $this->assertFileIsReadable($envFile);

        self::$envIsSet = (bool)(new Dotenv($this->getRootDirectory(), $this->getEnvFileName()))->load();
    }
1089050
def set_up(self):
        """"""
        self.path.profile = self.path.gen.joinpath("profile")

        if not self.path.profile.exists():
            self.path.profile.mkdir()

        self.python = hitchpylibrarytoolkit.project_build(
            "strictyaml",
            self.path,
            self.given["python version"],
            {"ruamel.yaml": self.given["ruamel version"]},
        ).bin.python

        self.example_py_code = (
            ExamplePythonCode(self.python, self.path.gen)
            .with_code(self.given.get("code", ""))
            .with_setup_code(
                self.given.get("setup", "")
            )
            .with_terminal_size(160, 100)
            .with_strings(
                yaml_snippet_1=self.given.get("yaml_snippet_1"),
                yaml_snippet=self.given.get("yaml_snippet"),
                yaml_snippet_2=self.given.get("yaml_snippet_2"),
                modified_yaml_snippet=self.given.get("modified_yaml_snippet"),
            )
        )
171368
def init_ui(state):
    """"""
    app = state.app
    init_common(app)

    # Register blueprint for templates
    app.register_blueprint(
        blueprint, url_prefix=app.config['USERPROFILES_PROFILE_URL'])
942991
private function initialize()
    {
        foreach ($this->globs as $glob) {
            $glob = VarUtils::resolve($glob, $this->getVars(), $this->getValues());

            if (false !== $paths = glob($glob)) {
                foreach ($paths as $path) {
                    if (is_file($path)) {
                        $asset = new FileAsset($path, array(), $this->getSourceRoot(), null, $this->getVars());
                        $asset->setValues($this->getValues());
                        $this->add($asset);
                    }
                }
            }
        }

        $this->initialized = true;
    }
1369043
protected function init()
    {
        $this->namespaces  = array();
        $this->currentPath = '/';
        $this->pathData    = array();
        $this->parse       = FALSE;
    }
1146838
def init(self):
        
        self.logger.info('Start initialize dir [%s]', self.basePath)
        # Clean the directory
        for name in os.listdir(self.basePath):
            path = os.path.join(self.basePath, name)
            if os.path.isdir(path):
                shutil.rmtree(path)
            else:
                os.unlink(path)
        # Prepare dirs and files
        self.logger.info('Prepare dirs and files')
        for name in self.DIRS:
            os.mkdir(os.path.join(self.basePath, name))
        with open(os.path.join(self.basePath, self.FILE_INDEX), 'wb') as fd:
            pass
        with open(os.path.join(self.basePath, self.FILE_SERIAL), 'wb') as fd:
            print >>fd, 1000
        # Format the config file
        env = jinja2.Environment(
                loader = jinja2.FileSystemLoader(os.path.dirname(os.path.abspath(__file__))),
                trim_blocks = True,
                lstrip_blocks = True
                )
        template = env.get_template('openssl.config.template')
        content = template.render(basePath = self.basePath)
        with open(os.path.join(self.basePath, self.FILE_CONFIG), 'wb') as fd:
            print >>fd, content
25836
public function init()
    {
        $filename = $this->getDirectory().DIRECTORY_SEPARATOR.$this->initFilename;

        if (File::exists($filename)) {
            File::requireOnce($filename);
        }
    }
296701
def init(directory=None):
    
    if directory is not None and not path.exists(directory):
        makedirs(directory)
    else:
        print('%s already exists, populating with template files' % (directory))
        directory = ''

    if not path.isfile(path.join(directory,'style.css')):
        grab('style.css', directory)
        print('Added sample style')
    if not path.isfile(path.join(directory,'template.jinja')):
        grab('template.jinja', directory)
        print('Added sample template.jinja')
    if not path.isfile(path.join(directory,'content.rst')):
        grab('content.rst', directory)
        print('Added sample content.rst')
1280680
def initialize():
        
        from zsl.interface.web.performers.default import create_not_found_mapping
        from zsl.interface.web.performers.resource import create_resource_mapping

        create_not_found_mapping()
        create_resource_mapping()
1020671
private static function init() {
		static::$manager = new MountManager(self::$filesystems);
		$local           = new CachedAdapter(new Local("/", LOCK_EX, Local::SKIP_LINKS), new CacheStore());
		self::addAdapter("local", $local);
		self::addAdapter("file", $local);
		self::$manager->addPlugin(new ListPaths());
	}
683534
def profile(self, profile):
        
        # clear staging data
        self._staging_data = None
        # retrieve language from install.json or assume Python
        lang = profile.get('install_json', {}).get('programLanguage', 'PYTHON')
        # load instance of ArgBuilder
        profile_args = ArgBuilder(lang, self.profile_args(profile.get('args')))
        # set current profile
        self._profile = profile
        # attach instance to current profile
        self._profile['profile_args'] = profile_args
        # load tcex module after current profile is set
        self.load_tcex()
        # select report for current profile
        self.reports.profile(profile.get('profile_name'))
        # create required directories for tcrun to function
        self._create_tc_dirs()
764667
def init_current_directory():
    """"""
    settings_directory=project_path+'/.dry'
    settings_file=settings_directory+'/config.py'
    if os.path.isdir(settings_directory):
	# already initialized
	print("directory already initialized.")
	return
    # init
    os.makedirs(settings_directory)
    f = open(settings_file,'w')
    print(sample_config_file, file=f)
    f.close()
201709
public function init()
    {
        parent::init();

        ProfileAsset::register($this->view);

        echo $this->renderSidebar();

        echo Html::beginTag('div', ['class' => 'profile-content']);
    }
1011025
def save(self):
        
        config = self.profiledir + '/config'
        if not isdir(self.profiledir):
            makedirs(self.profiledir)

        cp = SafeConfigParser()

        cp.add_section('ssh')
        cp.set('ssh', 'private_key', self.ssh_private_key)
        cp.set('ssh', 'public_key', self.ssh_public_key)

        with open(config, 'w') as cfile:
            cp.write(cfile)
594540
private void loadProfiles() {
    URL convention_default = resources.getGlobal();
    if (null == convention_default) { throw new RuntimeException("cannot find convention-default.properties!"); }
    List<Profile> defaultProfiles = buildProfiles(convention_default, true);
    if (!defaultProfiles.isEmpty()) {
      defaultProfile = defaultProfiles.get(0);
    }
    for (URL url : resources.getLocals()) {
      profiles.addAll(buildProfiles(url, false));
    }
  }