This cell is inserted at the start of each notebook to set the working
    directory to the correct folder.
487451
def _preamble_cell(path):
    
    code = dedent(
        '''
    # HIDDEN
    # Clear previously defined variables
    %reset -f
    '''.format(path)
    )
    return nbformat.v4.new_code_cell(source=code)
1017119
private void setTaskOutputDir() {
    if (this.jobState.contains(ConfigurationKeys.WRITER_OUTPUT_DIR)) {
      LOG.warn(String.format("Property %s is deprecated. No need to use it if %s is specified.",
          ConfigurationKeys.WRITER_OUTPUT_DIR, ConfigurationKeys.TASK_DATA_ROOT_DIR_KEY));
    } else {
      String workingDir = this.jobState.getProp(ConfigurationKeys.TASK_DATA_ROOT_DIR_KEY);
      this.jobState.setProp(ConfigurationKeys.WRITER_OUTPUT_DIR, new Path(workingDir, TASK_OUTPUT_DIR_NAME).toString());
      LOG.info(String
          .format("Writer Output Directory is set to %s.", this.jobState.getProp(ConfigurationKeys.WRITER_OUTPUT_DIR)));
    }
  }
1138540
public void setWorkingDirectory(Path dir) throws IOException {
    ensureState(JobState.DEFINE);
    conf.setWorkingDirectory(dir);
  }
1011305
private void createSystemDataFolder() throws IOException {
        if(!Files.exists(systemDataLocation.toPath()))
            Files.createDirectories(systemDataLocation.toPath());
    }
164014
def jupyter_notebook(script_blocks, gallery_conf):
    
    first_cell = gallery_conf.get("first_notebook_cell", "%matplotlib inline")
    work_notebook = jupyter_notebook_skeleton()
    if first_cell is not None:
        add_code_cell(work_notebook, first_cell)
    fill_notebook(work_notebook, script_blocks)

    return work_notebook
633238
protected boolean setupWorkingDirectory() {
    if (!FileUtils.isDirectoryExists(schedulerWorkingDirectory)) {
      FileUtils.createDirectory(schedulerWorkingDirectory);
    }

    String topologyPackageURL = String.format("file://%s", Context.topologyPackageFile(config));
    String topologyPackageDestination = Paths.get(
        schedulerWorkingDirectory, "topology.tar.gz").toString();


    return SchedulerUtils.curlAndExtractPackage(
        schedulerWorkingDirectory, topologyPackageURL,
        topologyPackageDestination, true, Context.verbose(config));
  }
512445
def set_folder(self, folder='assets'):
        
        folder = folder.replace('/', '.')
        self._endpoint = 'files/{folder}'.format(folder=folder)
787508
def work_dir(path):
    '''
    

    '''
    starting_directory = os.getcwd()
    try:
        os.chdir(path)
        yield
    finally:
        os.chdir(starting_directory)
1137319
private function setupDirectories()
    {
        // Check if the internal directory is present
        if(!file_exists($dir = config('assetprocessor.cache.directory')))
        {
            // It doesn't, so make the folder
            mkdir($dir, 0777, true);
        }

        // Check if the external directory is available
        if(!file_exists($dir = config('assetprocessor.cache.external', config('assetprocessor.cache.directory'))))
        {
            // It doesn't, so make the folder
            mkdir($dir, 0777, true);
        }

        // Check if the external directory is available (CSS)
        if(!file_exists($dir = config('assetprocessor.cache.external', config('assetprocessor.cache.directory')) . '/css'))
        {
            // It doesn't, so make the folder
            mkdir($dir, 0777, true);
        }

        // Check if the external directory is available (JavaScript)
        if(!file_exists($dir = config('assetprocessor.cache.external', config('assetprocessor.cache.directory')) . '/js'))
        {
            // It doesn't, so make the folder
            mkdir($dir, 0777, true);
        }
    }
1199676
def setup(interactive, not_relative, dry_run, reset, root_dir, testuser):
    """"""

    click.echo("[cellpy] (setup)")

    # generate variables
    init_filename = create_custom_init_filename()
    userdir, dst_file = get_user_dir_and_dst(init_filename)

    if testuser:
        if not root_dir:
            root_dir = os.getcwd()

        click.echo(f"[cellpy] (setup) DEV-MODE testuser: {testuser}")
        init_filename = create_custom_init_filename(testuser)
        userdir = root_dir
        dst_file = get_dst_file(userdir, init_filename)
        click.echo(f"[cellpy] (setup) DEV-MODE userdir: {userdir}")
        click.echo(f"[cellpy] (setup) DEV-MODE dst_file: {dst_file}")

    if not pathlib.Path(dst_file).is_file():
        reset = True

    if interactive:
        click.echo(" interactive mode ".center(80, "-"))
        _update_paths(root_dir, not not_relative, dry_run=dry_run, reset=reset)
        _write_config_file(
            userdir, dst_file,
            init_filename, dry_run,
        )
        _check()

    else:
        _write_config_file(userdir, dst_file, init_filename, dry_run)
        _check()
862586
protected function setThemeDirectory()
    {
        $pos = strrpos($this->dirPath, DIRECTORY_SEPARATOR);

        $this->directory = substr($this->dirPath, $pos + 1);
    }
635069
protected void setupStartFolder(String startFolder) {

        try {
            CmsObject cmsCopy = OpenCms.initCmsObject(m_cms);
            if (m_site.getValue() != null) {
                cmsCopy.getRequestContext().setSiteRoot((String)m_site.getValue());
            } else {
                cmsCopy.getRequestContext().setSiteRoot("");
            }
            m_startfolder.requireFolder();
            m_startfolder.disableSiteSwitch();
            m_startfolder.setValue(cmsCopy.getRequestContext().addSiteRoot(startFolder == null ? "/" : startFolder));
            m_startfolder.setCmsObject(cmsCopy);
            m_startfolder.setUseRootPaths(true);
            if (!m_visSites) {
                try {
                    m_startfolder.setValue(
                        OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(cmsCopy, m_ou.getValue()).get(
                            0).getRootPath());
                } catch (CmsException e1) {
                    LOG.error("unable to read resources for ou", e1);
                }
            }
            m_startfolder.setEnabled(m_visSites);
        } catch (CmsException e) {
            LOG.error("Unable to ini CmsObject", e);
        }
    }
982882
public void setupCellPositoin(final CellPosition address) {
        ArgUtils.notNull(address, "address");
        setupCellPositoin(address.getRow(), address.getColumn());
    }
265336
def set_base_dir(self, base_dir):
        

        self._base_dir = base_dir
        self.icon_cache.set_base_dir(base_dir)
1296966
def _workdir(self, line):
        '''

        '''
        workdir = self._setup('WORKDIR', line)
        line = "cd %s" %(''.join(workdir))
        self.install.append(line)
1237420
private void setupTaskCacheFileAccess(TaskControllerContext context) {
    String taskId = context.task.getTaskID().toString();
    JobID jobId = JobID.forName(getJobId(context));
    //Change permission for the task across all the disks
    for(String localDir : mapredLocalDirs) {
      File f = new File(localDir);
      File taskCacheDir = new File(f,TaskTracker.getLocalTaskDir(
          jobId.toString(), taskId, context.task.isTaskCleanupTask()));
      if(taskCacheDir.exists()) {
        changeDirectoryPermissions(taskCacheDir.getPath(), 
            FILE_PERMISSIONS, true);
      }          
    }//end of local directory Iteration 
  }
752852
private function initDirectoryStructure()
  {
    if (!file_exists(TL_ROOT . '/' . $this->getDmsBaseDirectory()))
    {
      mkdir(TL_ROOT . '/' . $this->getDmsBaseDirectory(), 0775, true);
      $objDir = \Dbafs::addResource($this->getDmsBaseDirectory());
      
      $objFolder = new \Folder($this->getDmsBaseDirectory());
			$objFolder->unprotect(); 
      
      mkdir(TL_ROOT . '/' . $this->getDmsBaseDirectory() . "/temp", 0775, true);
      $objDir = \Dbafs::addResource($this->getDmsBaseDirectory() . "/temp");
    }
  }