Setup directories.
357659
def setup_directories(base_dir, subdirs):
  """"""
  base_dir = os.path.expanduser(base_dir)
  tf.gfile.MakeDirs(base_dir)

  all_dirs = {}
  for subdir in subdirs:
    if isinstance(subdir, six.string_types):
      subdir_tuple = (subdir,)
    else:
      subdir_tuple = subdir
    dir_name = os.path.join(base_dir, *subdir_tuple)
    tf.gfile.MakeDirs(dir_name)
    all_dirs[subdir] = dir_name
  return all_dirs
470199
def _setup_piddir(self):
        """"""
        if self.pidfile is None:
            return
        piddir = os.path.dirname(self.pidfile)
        if not os.path.isdir(piddir):
            # Create the directory with sensible mode and ownership
            os.makedirs(piddir, 0o777 & ~self.umask)
            os.chown(piddir, self.uid, self.gid)
385388
protected function setup()
    {
        if (!$this->dir) {
            // Greate a temporary directory.
            $tempfile = tempnam(sys_get_temp_dir(), '');
            mkdir($tempfile.'.git');
            if (file_exists($tempfile)) {
                unlink($tempfile);
            }
            $this->dir = $tempfile.'.git';
            $this->git = $this->wrapper->init($this->dir);
        }
        if ($this->git) {
            $this->git->config('user.name', 'GitMerge');
            $this->git->config('user.email', 'gitmerge@php-merge.example.com');
            $this->git->config('merge.conflictStyle', 'diff3');
        }
    }
1120027
private void setupFile() {
        if (!new File(directory).exists() && !new File(directory).mkdirs()) {
            try {
                throw new IOException("Unable to create output directory");
            } catch (IOException e) {
                log.info(e);
            }
        }
        if (!file.exists()) {
            try {
                if (!file.createNewFile()) {
                    throw new IOException("Unable to create output file");
                }
            } catch (IOException e) {
                log.error(e);
            }
        }
    }
340619
public void setDirectories(java.util.Collection<Directory> directories) {
        if (directories == null) {
            this.directories = null;
            return;
        }

        this.directories = new java.util.ArrayList<Directory>(directories);
    }
303260
def _expand_directories(paths):
    """"""
    for path in paths:
        path_ = Path(path)
        if path_.is_dir():
            for expanded in path_.rglob('*'):
                yield str(expanded)
        else:
            yield path
107083
def initialize_directories(self, root_dir):
        """"""
        if not root_dir:
            root_dir = os.path.expanduser('~')

        # Create config directory, if it doesn't exist
        self.config_dir = os.path.join(root_dir, '.config/pueue')
        if not os.path.exists(self.config_dir):
            os.makedirs(self.config_dir)
205173
def makedirs(path, mode=0o777, exist_ok=False):
    """"""
    os.makedirs(path, mode, exist_ok)
787367
def install(cls):
        """"""
        [os.makedirs('{}/{}'.format(cls.home, cls.dirs[d])) for d in cls.dirs]
848218
def mk_dir(self) :
        """"""
        if not os.path.exists(self.abs) :
            os.makedirs(self.abs)
1097332
def mkdir(path, recursive=True, **kwargs):
    """"""
    import os
    if recursive:
        os.makedirs(path, **kwargs)
    else:
        os.mkdir(path, **kwargs)
441463
protected function setupUriRewrites()
    {
        foreach ($this->sources as $key => $source) {
            $file = $this->env->normalizePath($source->getFilePath());
            $minifyOptions = $source->getMinifierOptions();

            if ($file
                && !isset($minifyOptions['currentDir'])
                && !isset($minifyOptions['prependRelativePath'])) {
                $minifyOptions['currentDir'] = dirname($file);
                $source->setMinifierOptions($minifyOptions);
            }
        }
    }
191562
private function setup()
    {
        self::$version = '3.1.7';
        self::$src = dirname(__FILE__);
        self::$dir = dirname(dirname(__FILE__));
        self::$url = $this->getCuztomUrl(self::$src);

        // Do
        do_action('cuztom_setup');
    }
123604
def set_up(self):
        """"""
        self.path.state = self.path.gen.joinpath("state")
        if self.path.state.exists():
            self.path.state.rmtree(ignore_errors=True)
        self.path.state.mkdir()

        for script in self.given.get("scripts", []):
            script_path = self.path.state.joinpath(script)

            if not script_path.dirname().exists():
                script_path.dirname().makedirs()

            script_path.write_text(self.given["scripts"][script])
            script_path.chmod("u+x")

        for filename, contents in self.given.get("files", {}).items():
            self.path.state.joinpath(filename).write_text(contents)

        self.python = hitchpylibrarytoolkit.project_build(
            "commandlib", self.path, self.given["python version"]
        ).bin.python

        self.example_py_code = (
            ExamplePythonCode(self.python, self.path.state)
            .with_code(self.given.get("code", ""))
            .with_setup_code(self.given.get("setup", ""))
        )
225814
public function setupRoutes()
    {
        foreach ($this->paths as $oldPath => &$newPath) {
            $this->addRedirection($oldPath, $newPath);
        }
    }
694553
protected function createDirectories()
    {
        if (! is_dir(base_path('resources/views/auth/verify-emails'))) {
            mkdir(base_path('resources/views/auth/verify-emails'), 0755, true);
        }

        if (! is_dir(base_path('resources/views/auth/emails'))) {
            mkdir(base_path('resources/views/auth/emails'), 0755, true);
        }
    }
48767
def create_dir_unless_exists(*args):
    """"""
    path = os.path.join(*args)
    if not os.path.isdir(path):
        os.makedirs(path)