Returns the path extensions from environment or a default
500718
def get_pathext(default_pathext=None):
    """"""
    if default_pathext is None:
        default_pathext = os.pathsep.join([ '.COM', '.EXE', '.BAT', '.CMD' ])
    pathext = os.environ.get('PATHEXT', default_pathext)
    return pathext
981684
def path(self):
        
        return "/".join([
            part
            for part in [
                self.version,
                self.qualifier,
            ]
            if part
        ])
161049
def get_stacker_env_file(path, environment, region):
    """"""
    for name in gen_stacker_env_files(environment, region):
        if os.path.isfile(os.path.join(path, name)):
            return name
    return "%s-%s.env" % (environment, region)
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))
949767
def get_environ(cls, prefix):
        
        return ((key[len(prefix) + 1:], value)
                for key, value in os.environ.items()
                if key.startswith('%s_' % prefix))
707478
def _get_library_search_paths():
    
    search_paths = [
        '',
        '/usr/lib64',
        '/usr/local/lib64',
        '/usr/lib', '/usr/local/lib',
        '/run/current-system/sw/lib',
        '/usr/lib/x86_64-linux-gnu/',
        os.path.abspath(os.path.dirname(__file__))
    ]

    if sys.platform == 'darwin':
        path_environment_variable = 'DYLD_LIBRARY_PATH'
    else:
        path_environment_variable = 'LD_LIBRARY_PATH'
    if path_environment_variable in os.environ:
        search_paths.extend(os.environ[path_environment_variable].split(':'))
    return search_paths
1255811
function resolveEnvSources(env) {
  let paths = [];

  if (process.env[env]) {
    paths = process.env[env].includes(path.delimiter) ? process.env[env].split(path.delimiter) : [process.env[env]];
  }

  return paths;
}
1267392
def get_default_path_config():
    
    if 'SAWTOOTH_HOME' in os.environ:
        home_dir = os.environ['SAWTOOTH_HOME']
        return PathConfig(
            config_dir=os.path.join(home_dir, 'etc'),
            log_dir=os.path.join(home_dir, 'logs'),
            data_dir=os.path.join(home_dir, 'data'),
            key_dir=os.path.join(home_dir, 'keys'),
            policy_dir=os.path.join(home_dir, 'policy'))

    if os.name == 'nt':
        # Paths appropriate for Windows.
        base_dir = \
            os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
        return PathConfig(
            config_dir=os.path.join(base_dir, 'conf'),
            log_dir=os.path.join(base_dir, 'logs'),
            data_dir=os.path.join(base_dir, 'data'),
            key_dir=os.path.join(base_dir, 'conf', 'keys'),
            policy_dir=os.path.join(base_dir, 'policy'))

    # Paths appropriate for modern Linux distributions.
    return PathConfig(
        config_dir='/etc/sawtooth',
        log_dir='/var/log/sawtooth',
        data_dir='/var/lib/sawtooth',
        key_dir='/etc/sawtooth/keys',
        policy_dir='/etc/sawtooth/policy')
579394
def _get_path(args_path: Optional[str]) -> str:
    
    env_path = os.getenv(PATH_ENVIRONMENT_VARIABLE)
    for path, source in ((args_path, 'arg'),
                         (env_path, 'env')):
        if not path:
            LOG.debug(f"config.load: skipping {source} (path None)")
            continue
        else:
            LOG.debug(f"config.load: using config path {path} from {source}")
            return path
    return DEFAULT_PATH
1230915
def added_env_paths(env_vars, env=None):
    
    if not env_vars:
        return None

    if not env:
        env = dict(os.environ)

    result = dict(env)
    for env_var, paths in env_vars.items():
        separator = paths[0]
        paths = paths[1:]
        current = env.get(env_var, "")
        current = [x for x in current.split(separator) if x]

        added = 0
        for path in paths.split(separator):
            if path not in current:
                added += 1
                current.append(path)

        if added:
            result[env_var] = separator.join(current)

    return result
791784
def xdg_config_dirs():
    
    paths = []
    if 'XDG_CONFIG_HOME' in os.environ:
        paths.append(os.environ['XDG_CONFIG_HOME'])
    if 'XDG_CONFIG_DIRS' in os.environ:
        paths.extend(os.environ['XDG_CONFIG_DIRS'].split(':'))
    else:
        paths.append('/etc/xdg')
    paths.append('/etc')
    return paths
695267
def addextension(path, ext=None):
    
    if ext:
        if '*' in path:
            return path
        elif os.path.splitext(path)[1]:
            return path
        else:
            if not ext.startswith('.'):
                ext = '.'+ext
            if not path.endswith(ext):
                if not path.endswith(os.path.sep):
                    path += os.path.sep
                return path + '*' + ext
            else:
                return path
    else:
        return path
542877
def filepaths(self):
        
        return nativestring(self._filepathEdit.text()).split(os.path.pathsep)
734206
def get_files(path:PathOrStr, extensions:Collection[str]=None, recurse:bool=False,
              include:Optional[Collection[str]]=None)->FilePathList:
    ""
    if recurse:
        res = []
        for i,(p,d,f) in enumerate(os.walk(path)):
            # skip hidden dirs
            if include is not None and i==0:  d[:] = [o for o in d if o in include]
            else:                             d[:] = [o for o in d if not o.startswith('.')]
            res += _get_files(path, p, f, extensions)
        return res
    else:
        f = [o.name for o in os.scandir(path) if o.is_file()]
        return _get_files(path, path, f, extensions)
185465
function getFiles () {
  const FUCK_ENV = process.env.FUCK_ENV
    || process.env.npm_package_config_FUCK_ENV
    || FUCK_ENV_DEFAULT
  return FUCK_ENV.split(',').map(file => path.resolve(root, file))
}
135712
def _get_environ_overrides() -> Dict[str, str]:
    
    return {
        ce.name: os.environ['OT_API_' + ce.name.upper()]
        for ce in CONFIG_ELEMENTS
        if 'OT_API_' + ce.name.upper() in os.environ}
693965
def resolve_extensions(bot: commands.Bot, name: str) -> list:
    

    if name.endswith('.*'):
        module_parts = name[:-2].split('.')
        path = pathlib.Path(module_parts.pop(0))

        for part in module_parts:
            path = path / part

        return find_extensions_in(path)

    if name == '~':
        return list(bot.extensions.keys())

    return [name]