Returns all model paths in the model_dir.
554715
def get_model_paths(model_dir):
    """"""
    all_models = gfile.Glob(os.path.join(model_dir, '*.meta'))
    model_filenames = [os.path.basename(m) for m in all_models]
    model_numbers_names = [
        (shipname.detect_model_num(m), shipname.detect_model_name(m))
        for m in model_filenames]
    model_names = sorted(model_numbers_names)
    return [os.path.join(model_dir, name[1]) for name in model_names]
309742
def find_file_paths(self):
        
        paths = []
        for root, dirs, files in os.walk(self.directory, topdown=True):
            rel_path = os.path.relpath(root, self.directory)
            for f in files:
                if rel_path == '.':
                    path = (f, os.path.join(root, f))
                else:
                    path = (os.path.join(rel_path, f), os.path.join(root, f))
                paths.append(path)
        return paths
656202
def list_directory(self, *args, **kwargs):
		
		return tuple(self.dav_client().list(self.session_path()))
390095
def _iter_full_paths(path_list):
    
    for path in path_list:
        if not os.path.isdir(path):
            full_path = os.path.realpath(path)
            yield path
        else:
            for root, dirs, filenames in os.walk(path):
                for filename in filenames:
                    full_path = os.path.realpath(os.path.join(root, filename))
                    yield full_path
231240
def get_scheme_dirs():
    """"""
    scheme_glob = rel_to_cwd('schemes', '**', '*.yaml')
    scheme_groups = glob(scheme_glob)
    scheme_groups = [get_parent_dir(path) for path in scheme_groups]
    return set(scheme_groups)
600085
private function getAllModels()
    {
        $modules      = Safan::handler()->getModules();
        $modelClasses = [];

        foreach ($modules as $moduleName => $modulePath) {
            $modelsPath = APP_BASE_PATH . DS . $modulePath . DS . 'Models';

            $modelFiles = [];

            if (is_dir($modelsPath)) {
                $modelFiles = scandir($modelsPath);
            }

            foreach ($modelFiles as $modelFile) {
                if ($modelFile != '.' && $modelFile != '..' && is_dir($modelsPath . DS . $modelFile)) {
                    $subModelFiles = scandir($modelsPath . DS . $modelFile);

                    foreach ($subModelFiles as $subModelFile) {
                        if ($subModelFile != '.' && $subModelFile != '..' && is_file($modelsPath . DS . $modelFile . DS . $subModelFile)) {
                            $subModelName   = substr($subModelFile, 0, -4);
                            $modelClasses[] = [
                                'name'      => $subModelName,
                                'namespace' => '\\' . $moduleName . '\\Models\\' . $modelFile . '\\' . $subModelName,
                                'file'      => $modelsPath . DS . $modelFile . DS . $subModelFile
                            ];
                        }
                    }
                } elseif ($modelFile != '.' && $modelFile != '..' && is_file($modelsPath . DS . $modelFile)) {
                    $modelName      = substr($modelFile, 0, -4);
                    $modelClasses[] = [
                        'name'      => $modelName,
                        'namespace' => '\\' . $moduleName . '\\Models\\' . $modelName,
                        'file'      => $modelsPath . DS . $modelFile
                    ];
                }

            }
        }

        return $modelClasses;
    }
1345884
def _container_path(model,
                    key=None,
                    container=None,
                    delim=DEFAULT_TARGET_DELIM):
    '''
    
    '''
    if not key:
        key = ''
    if not container:
        container = 'config'
    for model_key, model_value in six.iteritems(model):
        if key:
            key_depth = '{prev_key}{delim}{cur_key}'.format(prev_key=key,
                                                            delim=delim,
                                                            cur_key=model_key)
        else:
            key_depth = model_key
        if model_key == container:
            yield key_depth
        else:
            for value in _container_path(model_value,
                                         key=key_depth,
                                         container=container,
                                         delim=delim):
                yield value
1047361
def get_roles_paths(self):
        '''
        
        '''
        roles  = []

        for path in self.config.ROLES:
            roles.append(self.get_absolute_path(path))

        return roles
1155586
def cache_dir() -> str:
        """"""
        if config.VENDOR is None:
            raise RuntimeError("modelforge is not configured; look at modelforge.configuration. "
                               "Depending on your objective you may or may not want to create a "
                               "modelforgecfg.py file which sets VENDOR and the rest.")
        return os.path.join("~", "." + config.VENDOR)
66372
def get_models():
    
    all_models = gfile.Glob(os.path.join(models_dir(), '*.meta'))
    model_filenames = [os.path.basename(m) for m in all_models]
    model_numbers_names = sorted([
        (shipname.detect_model_num(m), shipname.detect_model_name(m))
        for m in model_filenames])
    return model_numbers_names
139833
def get_markdown_files(self, dir_):
        
        md_files = OrderedSet()
        for root, _, files in os.walk(dir_):
            for name in files:
                split = os.path.splitext(name)
                if len(split) == 1:
                    continue
                if split[1] in ('.markdown', '.md', '.yaml'):
                    md_files.add(os.path.join(root, name))
        return md_files
1049648
public function getModelLinks(Model $model) {
        $models = Configure::read('Admin.modelLinks');

        if (isset($models[$model->qualifiedName])) {
            return $models[$model->qualifiedName];
        }

        return array();
    }
876209
def set_model_pathnames(self):
        """"""
        self.control_path = self.expt.control_path
        self.input_basepath = self.expt.lab.input_basepath
        self.work_path = self.expt.work_path
        self.codebase_path = self.expt.lab.codebase_path

        if len(self.expt.models) > 1:

            self.control_path = os.path.join(self.control_path, self.name)
            self.work_path = os.path.join(self.work_path, self.name)
            self.codebase_path = os.path.join(self.codebase_path, self.name)

        # NOTE: Individual models may override the work subdirectories
        self.work_input_path = self.work_path
        self.work_restart_path = self.work_path
        self.work_output_path = self.work_path
        self.work_init_path = self.work_path

        self.exec_prefix = self.config.get('exe_prefix', '')
        self.exec_name = self.config.get('exe', self.default_exec)
        if self.exec_name:
            # By default os.path.join will not prepend the lab bin_path
            # to an absolute path
            self.exec_path = os.path.join(self.expt.lab.bin_path,
                                          self.exec_name)
        else:
            self.exec_path = None

        if self.exec_path:
            # Make exec_name consistent for models with fully qualified path.
            # In all cases it will just be the name of the executable without a
            # path
            self.exec_name = os.path.basename(self.exec_path)
881834
def directories(self):
        
        directories_description = [
            self.project_name,
            self.project_name + '/conf',
            self.project_name + '/static',
        ]
        return directories_description
80280
def load(self, paths):
        
        for path in paths:
            self.models.append(Model(path))
849796
def load_model_data(self, path, model):
        
        if os.path.isdir(path):
            # try find a model data collection
            if os.path.isfile(os.path.join(path, '_all.yml')):
                self.load_model_data_collection(path, model)
            self.load_model_data_from_files(path, model)
            self.session.commit()
1118861
private Pair<Map<String, Model>, Map<String, Set<String>>> fetchModels() {
    Map<String, Model> all_models = null;
    Map<String, Set<String>> all_models_cols = null;

    if (this.find_compatible_models) {
      // caches for this request
      all_models = (new Models()).fetchAll();
      all_models_cols = new TreeMap<String, Set<String>>();

      for (Map.Entry<String, Model> entry : all_models.entrySet()) {
        all_models_cols.put(entry.getKey(), new TreeSet<String>(Arrays.asList(entry.getValue()._names)));
      }
    }
    return new Pair<Map<String, Model>, Map<String, Set<String>>>(all_models, all_models_cols);
  }