Create the Application's folders.
340215
protected function createStages()
    {
        // Get stages
        $availableStages = $this->connections->getAvailableStages();
        $originalStage = $this->connections->getCurrentConnectionKey()->stage;
        if (empty($availableStages)) {
            $availableStages = [null];
        }

        // Create folders
        $mapping = $this->config->get('remote.directories');
        foreach ($availableStages as $stage) {
            $this->connections->setStage($stage);
            $this->createFolder($mapping['releases']);
            $this->createFolder($mapping['current']);
            $this->createFolder($mapping['shared']);
        }

        if ($originalStage) {
            $this->connections->setStage($originalStage);
        }
    }
211066
def create_folder(cls, name, parent=None, project=None,
                      api=None):
        
        api = api or cls._API

        data = {
            'name': name,
            'type': cls.FOLDER_TYPE
        }

        if not parent and not project:
            raise SbgError('Parent or project must be provided')

        if parent and project:
            raise SbgError(
                'Providing both "parent" and "project" is not allowed'
            )

        if parent:
            data['parent'] = Transform.to_file(file_=parent)

        if project:
            data['project'] = Transform.to_project(project=project)

        response = api.post(url=cls._URL['create_folder'], data=data).json()
        return cls(api=api, **response)
766730
def create_app(self, apps_path, name):
        
        app_path = os.path.join(apps_path, name.lower())

        shutil.copytree(self.app_path, app_path)

        self.update_file(app_path, '__init__.py', {
            'name': name.lower()
        })

        self.update_file(app_path, 'apps.py', {
            'name': name.lower(),
            'verbose_name': name.capitalize()
        })
1165293
protected function createFolders()
    {
        foreach ($this->getFolderStructure() as $folder) {
            $newFolder = $this->twigStringRenderer->renderToString($folder, $this->data);
            $this->fs->mkdir($this->targetPath.DIRECTORY_SEPARATOR.$newFolder, self::DIRECTORY_MODE);

            $msg = '[mkdir] '.$this->targetPath.DIRECTORY_SEPARATOR.$newFolder;
            if ($this->reportingEnabled) {
                $this->report[] =$msg;
            }
        }
    }
1290003
def create_cache_directories(self):
        """"""
        if not os.path.isdir(self.package_cache_dir):
            if not os.path.isdir(self.stacker_cache_dir):
                os.mkdir(self.stacker_cache_dir)
            os.mkdir(self.package_cache_dir)
121118
def create_app():
    """"""
    app = Flask(__name__)
    app.config_from_envvar = app.config.from_envvar
    app.config_from_object = app.config.from_object
    configure_app(app)
    init_core(app)
    register_blueprints(app)
    return app
936301
public function createDirs()
    {
        if (!is_dir($this->getMediaPath())) {
            mkdir($this->getMediaPath());
        }

        if (!is_dir($this->getThumbnailPath())) {
            mkdir($this->getThumbnailPath());
        }
    }
458767
def create(self):
        """"""

        self.before_create()

        puts(green('Creating app context'))
        tdir = os.path.dirname(__file__)

        # Ensure the app context user exists
        user_ensure(self.user, home='/home/' + self.user)
        dir_ensure('/home/%s/.ssh' % self.user)

        t = '/home/%s/.ssh/authorized_keys'
        app_authorized_keys = t % env.user
        ctx_authorized_keys = t % self.user

        # Ensure the app user has the same authorized_keys as the admin user
        if file_exists(app_authorized_keys) and \
           not file_exists(ctx_authorized_keys):
            sudo('cp %s %s' % (app_authorized_keys, ctx_authorized_keys))
            file_attribs(ctx_authorized_keys, mode=755,
                         owner=self.user, group=self.user)

        # Actions to be performed with the app context user
        with settings(user=self.user):
            # Make sure the dot files exist
            # This is mostly necessary for virtualenvwrapper to work properly
            for f in ['bashrc', 'bash_profile', 'profile']:
                lfn = os.path.join(tdir, 'templates', '%s.tmpl' % f)
                contents = file_local_read(lfn) % self.__dict__
                rfn = '/home/%s/.%s' % (self.user, f)
                file_ensure(rfn, owner=self.user, group=self.user)
                file_update(rfn, lambda _: contents)

            # Make sure the sites folder exists
            dir_ensure('/home/%s/sites' % self.user)

            # Make sure the app's required folders exist
            for d in [self.root_dir, self.releases_dir, self.etc_dir,
                      self.log_dir, self.run_dir, self.shared_dir]:
                dir_ensure(d)

            # Create the virtualenv
            run('mkvirtualenv ' + self.name)

        self.after_create()
772500
protected function createDirectories()
    {
        if (! is_dir(app_path('Http/Controllers/Teamwork'))) {
            mkdir(app_path('Http/Controllers/Teamwork'), 0755, true);
        }
        if (! is_dir(app_path('Listeners/Teamwork'))) {
            mkdir(app_path('Listeners/Teamwork'), 0755, true);
        }
        if (! is_dir(base_path('resources/views/teamwork'))) {
            mkdir(base_path('resources/views/teamwork'), 0755, true);
        }
        if (! is_dir(base_path('resources/views/teamwork/emails'))) {
            mkdir(base_path('resources/views/teamwork/emails'), 0755, true);
        }
        if (! is_dir(base_path('resources/views/teamwork/members'))) {
            mkdir(base_path('resources/views/teamwork/members'), 0755, true);
        }
    }
1061114
protected function createFolders()
    {
        $dir    = null;
        $target = $this->getTargetDirectory();

        /** @noinspection IsEmptyFunctionUsageInspection */
        if (!empty($target)) {
            $dir = rtrim($target, '/') . DIRECTORY_SEPARATOR;
            $this->setTarget($dir);
        }

        if ($dir !== null && !is_dir($dir) && $this->isAllowCreateFolders()) {
            /** @noinspection NotOptimalIfConditionsInspection */
            /** @noinspection PhpUsageOfSilenceOperatorInspection */
            if (!@mkdir($dir, 0777, true) && !is_dir($dir)) {
                throw new Exception\NoSuchDirectoryException(
                    sprintf('Directory %s does not exists.', $dir)
                );
            }
        }
    }
479748
def _create_folder(self):

        '''  '''

    # import dependencies
        import os
        from labpack.platforms.localhost import localhostClient
        from labpack.records.id import labID

    # create folder in user app data
        record_id = labID()
        collection_name = 'Watson Speech2Text'
        localhost_client = localhostClient()
        app_folder = localhost_client.app_data(org_name=__team__, prod_name=__module__)
        if localhost_client.os in ('Linux', 'FreeBSD', 'Solaris'):
            collection_name = collection_name.replace(' ', '-').lower()
        collection_folder = os.path.join(app_folder, collection_name)
        clip_folder = os.path.join(collection_folder, record_id.id24)
        if not os.path.exists(clip_folder):
            os.makedirs(clip_folder)

        return clip_folder
205173
def makedirs(path, mode=0o777, exist_ok=False):
    """"""
    os.makedirs(path, mode, exist_ok)
819926
protected function makeDirs()
    {
        $this->basePath = rtrim($this->extensionDir, '/').'/'.ltrim($this->package, '/');

        $this->makeDir($this->dirs);
    }
77378
def create(self):
        
        if os.path.isfile(self.path):
            if not os.path.exists(self.path):
                with open(self.path, 'w') as fileobj:
                    fileobj.write('')
        else:
            os.makedirs(self.path)
542651
def merge(self):
        """"""
        temp_dir = self.temp_dir
        app_dir = self.application.directory
        for root, dirs, files in os.walk(temp_dir):
            for directory in dirs:
                directory = os.path.join(root, directory)
                directory = directory.replace(temp_dir, app_dir, 1)
                try:
                    os.mkdir(directory)
                except OSError:
                    pass
            for file in files:
                source = os.path.join(root, file)
                target = source.replace(temp_dir, app_dir, 1)
                relative_target = target.replace(app_dir, '.')
                action = 'r'
                if (
                    os.path.exists(target)
                    and not filecmp.cmp(source, target, shallow=False)
                    and os.stat(target).st_size > 0
                ):
                    # target exists, is not empty, and does not
                    # match source
                    if target.endswith('__init__.py'):
                        # default merge __init__.py files
                        # if non-empty, these should only
                        # contain imports from submoduiles
                        action = 'm'
                    elif target.endswith('base.py'):
                        # default skip base.py files
                        # these should be extended by the developer
                        action = 's'
                    else:
                        default = 'm'
                        action = click.prompt(
                            style.prompt(
                                '%s already exists, '
                                '[r]eplace, [s]kip, or [m]erge?' % (
                                    relative_target
                                ),
                            ),
                            default=style.default(default)
                        ) if self.interactive else default
                        action = click.unstyle(action).lower()
                        if action not in {'r', 'm', 's'}:
                            action = default

                if action == 's':
                    self.stdout.write(
                        '? %s' % style.white(relative_target),
                        fg='yellow'
                    )
                    continue
                if action == 'r':
                    with open(source, 'r') as source_file:
                        with open(target, 'w') as target_file:
                            target_file.write(source_file.read())
                    self.stdout.write(
                        style.green(
                            '+ %s' % style.white(relative_target)
                        )
                    )
                if action == 'm':
                    with open(target, 'r') as target_file:
                        with open(source, 'r') as source_file:
                            merged = merge(
                                target_file.read(),
                                source_file.read()
                            )
                    with open(target, 'w') as target_file:
                        target_file.write(merged)

                    self.stdout.write(
                        style.yellow('> %s' % style.white(relative_target))
                    )
646215
def create_directory(directory):
    """"""
    if os.path.exists(directory):
        rmtree(directory)
    os.makedirs(directory)
    return directory
848218
def mk_dir(self) :
        """"""
        if not os.path.exists(self.abs) :
            os.makedirs(self.abs)