Sets the folder that contains models for the local library
    @todo: add options to move things over etc..
    note: this is called from 'manager'
764091
def action_update_library_location(_location):
    

    # if not(os.path.exists(_location)):
    # 	os.mkdir(_location)
    # 	printDebug("Creating new folder..", "comment")

    printDebug("Old location: '%s'" % get_home_location(), "comment")

    if os.path.isdir(_location):

        config = SafeConfigParser()
        config_filename = ONTOSPY_LOCAL + '/config.ini'
        config.read(config_filename)
        if not config.has_section('models'):
            config.add_section('models')

        config.set('models', 'dir', _location)
        with open(config_filename, 'w') as f:
            config.write(
                f)  # note: this does not remove previously saved settings

        return _location
    else:
        return None
54866
def _set_up_savefolder(self):
        
        if not os.path.isdir(self.cells_path):
            os.mkdir(self.cells_path)

        if not os.path.isdir(self.figures_path):
            os.mkdir(self.figures_path)

        if not os.path.isdir(self.populations_path):
            os.mkdir(self.populations_path)
1202016
def add(model)
      documents = Util.Array(model).map { |m| prepare_full_update(m) }
      add_batch_documents(documents)
    end
173973
def __set_dir_properties(self):
        
        directories = [
            ("home", "The ROUGE home directory."),
            ("data", "The path of the ROUGE 'data' directory."),
            ("system", "Path of the directory containing system summaries."),
            ("model", "Path of the directory containing model summaries."),
            ]
        for (dirname, docstring) in directories:
            self.__create_dir_property(dirname, docstring)
401772
protected function setManifestItems()
    {
        $m = $this->manifest;

        if (!empty($m)) {
            if (isset($m['service']) && is_array($m['service'])) {
                foreach ($m['service'] as $item => $value) {
                    if ($this->isFileService($item, $value)) {
                        $this->storageItems[$item] = $value;
                    } else {
                        $this->nonStorageItems[$item] = $value;
                    }
                }
            }

            if (count($this->getServices()) == 0) {
                throw new InternalServerErrorException('No items found in package manifest.');
            }
        }
    }
351844
def set_item_count
  	  m = model_with_includes.where(self.where)
  	  n = self.near
  	  m = m.near(n[0], n[1]) if n
  	  @options['item_count'] = m.count
  	end
218861
function () {
                var jsonStr = localStorage.getItem('todos'),
                    models;
                if (jsonStr) {
                    models = JSON.parse(jsonStr);
                    if (models && models.length) {
                        this.reset(models);
                    }
                }
                return this;
            }
1304342
def set_model(self, model):
        
        # do the set model in reverse!
        # set model might trigger an update for the lower levels
        # but the lower ones have a different model, so it will fail anyways
        # this way the initial state after set_model is correct.
        self.model = model
        self._levels[0].set_model(model)
795740
public function buildPropelModels()
    {
        $fs = new Filesystem();

        // cache testing
        if ($fs->exists($this->getPropelModelDir() . 'hash')
            && file_get_contents($this->getPropelCacheDir() . 'hash') === file_get_contents($this->getPropelModelDir() . 'hash')) {
            return;
        }

        $fs->remove($this->getPropelModelDir());

        $this->runCommand(
            new ModelBuildCommand(),
            [
                '--config-dir' => $this->getPropelConfigDir(),
                '--schema-dir' => $this->getPropelSchemaDir(),
            ]
        );

        $fs->copy(
            $this->getPropelCacheDir() . 'hash',
            $this->getPropelModelDir() . 'hash'
        );
    }
163315
def setup_tempdir(dir, models, wav, alphabet, lm_binary, trie, binaries):
    
    '''
    if dir is None:
        dir = tempfile.mkdtemp(suffix='dsbench')

    sorted_models = all_files(models=models)
    if binaries is None:
        maybe_download_binaries(dir)
    else:
        print('Using local binaries: %s' % (binaries))
        shutil.copy2(binaries, dir)
    extract_native_client_tarball(dir)

    filenames = map(lambda x: os.path.join(dir, os.path.basename(x)), sorted_models)
    missing_models = filter(lambda x: not os.path.isfile(x), filenames)
    if len(missing_models) > 0:
        # If we have a ZIP file, directly extract it to the proper path
        if is_zip_file(models):
            print('Extracting %s to %s' % (models[0], dir))
            zipfile.ZipFile(models[0]).extractall(path=dir)
            print('Extracted %s.' % models[0])
        else:
            # If one model is missing, let's copy everything again. Be safe.
            for f in sorted_models:
                print('Copying %s to %s' % (f, dir))
                shutil.copy2(f, dir)

    for extra_file in [ wav, alphabet, lm_binary, trie ]:
        if extra_file and not os.path.isfile(os.path.join(dir, os.path.basename(extra_file))):
            print('Copying %s to %s' % (extra_file, dir))
            shutil.copy2(extra_file, dir)

    if ssh_conn:
        copy_tree(dir)

    return dir, sorted_models
104161
protected function _set_files(){
    // Shortcuts for files and dir
    if ( isset($this->cfg['params']['f']) ){
      $this->cfg['params']['files'] = $this->cfg['params']['f'];
      unset($this->cfg['params']['f']);
    }
    if ( isset($this->cfg['params']['d']) ){
      $this->cfg['params']['dir'] = $this->cfg['params']['d'];
      unset($this->cfg['params']['d']);
    }
    // File
    if ( !empty($this->cfg['ext']) && is_file($this->fpath.$this->cfg['url']) ){
      $res = $this->get_file();
    }
    // Preconfigured
    else if ( isset($this->cfg['params']['id']) ){
      $res = $this->get_preconfig();
    }
    // List of files
    else if ( isset($this->cfg['params']['files']) && is_dir($this->fpath.$this->cfg['url']) ){
      $res = $this->get_files();
    }
    // Directory content
    // Vue component
    else if ( isset($this->cfg['params']['dir']) && is_dir($this->fpath.$this->cfg['url']) ){
      $res = $this->get_dir();
    }
    else if ( $this->cfg['is_component'] && is_dir($this->fpath.$this->cfg['url']) ){
      //cpStart:
      $res = [];
      $this->cfg['num'] = 0;
      foreach ( $this->cfg['components'] as $i => $cp ){
        if ( !isset($res[$cp]) ){
          $res[$cp] = $this->get_dir($this->cfg['url'].$cp);
          if ( $res[$cp] ){
            $dir = false;
            foreach ( $res[$cp] as $type => $files ){
              if ( !$dir && count($files) ){
                $dir = $this->fpath.\dirname($files[0]);
              }
              $this->cfg['num'] += \count($files);
            }
            /*
            if ( $dir && is_file($dir.'/bbn.json') ){
              $json = json_decode(file_get_contents($dir.'/bbn.json'));
              if ( isset($json->components) ){
                foreach ( $json->components as $tmp ){
                  if ( !isset($res[$tmp]) && !\in_array($tmp, $this->cfg['components'], true) ){
                    $this->cfg['components'][] = $tmp;
                    goto cpStart;
                    break;
                  }
                }
              }
            }
            */
          }
        }
      }
    }
    // Last but not least, libraries!
    else if ( isset($this->cfg['params']['lib']) ){
      $res = $this->get_libs();
      // Adding dirs to config
      if ( !empty($this->cfg['params']['dirs']) ){
        $dirs = explode(',', $this->cfg['params']['dirs']);
        foreach ( $dirs as $d ){
          if ( $r = $this->get_dir($d) ){
            $this->add($res, $r);
          }
        }
      }
    }
    $this->cfg['content'] = $res ?? [];
    return $this;
  }
259165
def set_project_path(self, path):
        
        if path is None:
            self.project_path = None
            self.model().item(PROJECT, 0).setEnabled(False)
            if self.currentIndex() == PROJECT:
                self.setCurrentIndex(CWD)
        else:
            path = osp.abspath(path)
            self.project_path = path
            self.model().item(PROJECT, 0).setEnabled(True)
721433
def setdirs(outfiles):
    """"""
    for k in outfiles:
        fname=outfiles[k]
        dname= os.path.dirname(fname)
        if not os.path.isdir(dname):
            os.mkdir(dname)
461125
def makedir(self):
        
        try:
            os.makedirs(self.model_dir)
        except OSError as exception:
            if exception.errno != errno.EEXIST:
                raise
259861
public function setFiles()
    {
        $this->files = [];
        $path = $this->getValue();

        if (!preg_match('#^/#', $path)) {
            $path = $this->parser->getServer()->getPrefix().'/'.$path;
        }

        $iterator = new GlobIterator($path);
        foreach ($iterator as $path) {
            $this->files[] = $path;
        }

        return $this;
    }
199928
private function setupFolders()
    {
        $this->basePath = $this->kernelDir . '/config/bundles';
        $this->autoloadersPath = $this->basePath . '/autoloaders';
        $this->configPath = $this->basePath . '/config';
        $this->routingPath = $this->basePath . '/routing';
        $this->cachePath = $this->basePath . '/cache';

        $this->filesystem->mkdir(array(
            $this->basePath,
            $this->autoloadersPath,
            $this->configPath,
            $this->routingPath,
            $this->cachePath,));
    }
522596
def setup_dirs(self, storage_dir):
        ''''''
        self.storage_dir = expanduser(storage_dir)
        if ' ' in self.storage_dir:
            raise ValueError('storage dir path cannot contain spaces, please '
                             'specify a path with --storage-dir')
        self.build_dir = join(self.storage_dir, 'build')
        self.dist_dir = join(self.storage_dir, 'dists')