Get tools' paths.
436457
def get_tools_paths(self):
        """"""
        if settings.DEBUG or is_testing():
            return list(get_apps_tools().values())

        else:
            tools_root = settings.FLOW_TOOLS_ROOT
            subdirs = next(os.walk(tools_root))[1]

            return [os.path.join(tools_root, sdir) for sdir in subdirs]
29081
def _get_package_path(self):
        """"""
        if not self.package:
            return []
        if not hasattr(self, 'package_path'):
            m = __import__(self.package)
            parts = self.package.split('.')[1:]
            self.package_path = os.path.join(os.path.dirname(m.__file__), *parts)
        return [self.package_path]
1114197
def project_path(*names):
    """"""
    return os.path.join(os.path.dirname(__file__), *names)
475440
def get_paths(rlz):
    
    dic = {}
    if hasattr(rlz, 'sm_lt_path'):  # composite realization
        dic['source_model_tree_path'] = '_'.join(rlz.sm_lt_path)
        dic['gsim_tree_path'] = '_'.join(rlz.gsim_lt_path)
    else:  # simple GSIM realization
        dic['source_model_tree_path'] = ''
        dic['gsim_tree_path'] = '_'.join(rlz.lt_path)
    return dic
802956
def get_distribution_paths(name):
    """"""
    pyver = 'python' + sys.version[:3]

    paths = {
        'prefix' : '{prefix}',
        'data'   : '{prefix}/lib/{pyver}/site-packages',
        'purelib': '{prefix}/lib/{pyver}/site-packages',
        'platlib': '{prefix}/lib/{pyver}/site-packages',
        'headers': '{prefix}/include/{pyver}/{name}',
        'scripts': '{prefix}/bin',
    }

    # pip uses a similar path as an alternative to the system's (read-only)
    # include directory:
    if hasattr(sys, 'real_prefix'):  # virtualenv
        paths['headers'] = os.path.abspath(
            os.path.join(sys.prefix, 'include', 'site', pyver, name))

    # Replacing vars
    for key, val in paths.items():
        paths[key] = val.format(prefix=PREFIX, name=name, pyver=pyver)
    return paths
152099
def print_paths(self):
        """"""
        # Uses a list to get the order right
        ret = []
        for i in self._get_paths():
            if i not in ret:
                ret.append(i)
        return os.pathsep.join(ret)
96573
def getpaths(self,libname):
        """"""
        if os.path.isabs(libname):
            yield libname
        else:
            # FIXME / TODO return '.' and os.path.dirname(__file__)
            for path in self.getplatformpaths(libname):
                yield path

            path = ctypes.util.find_library(libname)
            if path: yield path
89352
def get_paths(self):
        
        paths = []
        for key, child in six.iteritems(self):
            if isinstance(child, TreeMap) and child:
                # current child is an intermediate node
                for path in child.get_paths():
                    path.insert(0, key)
                    paths.append(path)
            else:
                # current child is an endpoint
                paths.append([key])
        return paths
94711
def _get_and_create_paths(options):
    
    paths = _get_paths(options)
    paths.builddir.mkdir_p()
    paths.outdir.mkdir_p()
    paths.doctrees.mkdir_p()
    return paths
745169
def dirs(self):
        """"""
        contents = self.paths
        contents = (BinDir(path.path) for path in contents if path.is_dir)
        return contents
937620
def path(self):
        """"""
        names = []
        obj = self
        while obj:
            names.insert(0, obj.name)
            obj = obj.parent_dir
        sep = self.filesystem._path_separator(self.name)
        if names[0] == sep:
            names.pop(0)
            dir_path = sep.join(names)
            # Windows paths with drive have a root separator entry
            # which should be removed
            is_drive = names and len(names[0]) == 2 and names[0][1] == ':'
            if not is_drive:
                dir_path = sep + dir_path
        else:
            dir_path = sep.join(names)
        dir_path = self.filesystem.absnormpath(dir_path)
        return dir_path
527454
def results_path(self) -> str:
        """"""

        def possible_paths():
            yield self._results_path
            yield self.settings.fetch('path_results')
            yield environ.configs.fetch('results_directory')
            yield environ.paths.results(self.uuid)

        return next(p for p in possible_paths() if p is not None)
940054
def get_apps_tools():
    
    tools_paths = {}

    for app_config in apps.get_app_configs():
        proc_path = os.path.join(app_config.path, 'tools')
        if os.path.isdir(proc_path):
            tools_paths[app_config.name] = proc_path

    custom_tools_paths = getattr(settings, 'RESOLWE_CUSTOM_TOOLS_PATHS', [])
    if not isinstance(custom_tools_paths, list):
        raise KeyError("`RESOLWE_CUSTOM_TOOLS_PATHS` setting must be a list.")

    for seq, custom_path in enumerate(custom_tools_paths):
        custom_key = '_custom_{}'.format(seq)
        tools_paths[custom_key] = custom_path

    return tools_paths
569512
def get_paths(folder, ignore_endswith=ignore_endswith):
    '''
    '''
    folder = pathlib.Path(folder).resolve()
    files = folder.rglob("*")
    for ie in ignore_endswith:
        files = [ff for ff in files if not ff.name.endswith(ie)]
    return sorted(files)
232323
def path(self):
        """"""
        # If root, return '/'
        if self.dataset is self:
            return ''
        else:  # Otherwise recurse
            return self.dataset.path + '/' + self.name
863527
def list_tools(self):
        
        tools = []
        exists, sections = self.sections()
        if exists:
            for section in sections:
                options = {'section': section,
                           'built': None,
                           'version': None,
                           'repo': None,
                           'branch': None,
                           'name': None,
                           'groups': None,
                           'image_name': None}
                for option in list(options.keys()):
                    exists, value = self.option(section, option)
                    if exists:
                        options[option] = value
                if 'core' not in options['groups'] and 'hidden' not in options['groups']:
                    tools.append(options)
        return tools
1215717
def get_path():
    '''
    
    '''
    ret = salt.utils.stringutils.to_unicode(
        __utils__['reg.read_value'](
            'HKEY_LOCAL_MACHINE',
            'SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment',
            'PATH')['vdata']
    ).split(';')

    # Trim ending backslash
    return list(map(_normalize_dir, ret))