Returns the sawtooth configuration directory based on the
    SAWTOOTH_HOME environment variable (if set) or OS defaults.
488510
def _get_config_dir():
    
    if 'SAWTOOTH_HOME' in os.environ:
        return os.path.join(os.environ['SAWTOOTH_HOME'], 'etc')

    if os.name == 'nt':
        base_dir = \
            os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
        return os.path.join(base_dir, 'conf')

    return '/etc/sawtooth'
460848
def get_default_filepath(cls):
        """"""
        if not cls.config_files:
            return None
        if not cls.config_searchpath:
            return None
        filename = cls.config_files[0]
        filepath = cls.config_searchpath[0]
        return os.path.join(filepath, filename)
1282534
def get_default_location(self):
        
        res = []
        for location in self.distdefault:
            res.extend(self.get_location(location))
        return res
499001
def get_windows_dir():
    """"""
    try:
        import win32api
    except ImportError:
        windir = compat.getenv('SystemRoot', compat.getenv('WINDIR'))
    else:
        windir = win32api.GetWindowsDirectory()
    if not windir:
        raise SystemExit("Error: Can not determine your Windows directory")
    return windir
203981
def default_hass_config_dir():
    """"""
    data_dir = os.getenv("APPDATA") if os.name == "nt" else os.path.expanduser("~")
    return os.path.join(data_dir, ".homeassistant")
775305
def xdg_config_dir():
    '''
    
    '''
    xdg_config = os.getenv('XDG_CONFIG_HOME', os.path.expanduser('~/.config'))
    xdg_config_directory = os.path.join(xdg_config, 'salt')
    return xdg_config_directory
826617
function getHomePath () {
  if (process.platform === 'win32') {
    return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || process.env.HOME
  } else {
    return process.env.HOME
  }
}
1062291
def settings_directory():
    

    system = platform.system()

    basedir = None

    if system == 'Windows':
        if 'APPDATA' in os.environ:
            basedir = os.environ['APPDATA']

    # If we're not on Windows assume we're on some
    # kind of posix system or Mac, where the appropriate place would be
    # ~/.config
    if basedir is None:
        basedir = os.path.expanduser('~')
        basedir = os.path.join(basedir, '.config')

    settings_dir = os.path.abspath(os.path.join(basedir, 'IOTile-Core'))
    return settings_dir
871271
protected String getHadoopClientHome() {
    String h = env_.getProperty("HADOOP_HOME"); // standard Hadoop
    if (h == null) {
      //fail("Missing required environment variable: HADOOP_HOME");
      h = "UNDEF";
    }
    return h;
  }
730808
public function getConfigDir()
    {
        $home = getenv('PHPCRSH_HOME');

        if ($home) {
            return $home;
        }
        // handle windows ..
        if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
            if (!getenv('APPDATA')) {
                throw new \RuntimeException(
                    'The APPDATA or phpcrsh_HOME environment variable must be set for phpcrsh to run correctly'
                );
            }
            $home = strtr(getenv('APPDATA'), '\\', '/').'/phpcrsh';

            return $home;
        }

        if (!getenv('HOME')) {
            throw new \RuntimeException(
                'The HOME or phpcrsh_HOME environment variable must be set for phpcrsh to run correctly'
            );
        }

        $home = rtrim(getenv('HOME'), '/').'/.phpcrsh';

        return $home;
    }
268543
public File getStandaloneProfileConfigurationDirectory() {
        val file = environment.getProperty("cas.standalone.configurationDirectory", File.class);
        if (file != null && file.exists()) {
            LOGGER.trace("Received standalone configuration directory [{}]", file);
            return file;
        }

        return Arrays.stream(DEFAULT_CAS_CONFIG_DIRECTORIES)
            .filter(File::exists)
            .findFirst()
            .orElse(null);
    }
774747
def settings_dir(self):
        
        path = os.path.join(self.dir, '.dsb')
        utils.create_dir(path)
        return os.path.realpath(path)
944430
def _directory (self):
        """"""
        if self._filename is None:
            return os.path.join(self._ROOT_DIR, 'config')
        else:
            return os.path.dirname(self._filename)
1092648
def config(env=DEFAULT_ENV, default=None):
    """"""

    conf = {}

    s = os.environ.get(env, default)

    if s:
        conf = parse(s)

    return conf
694215
def site_config_dir(self):
        """"""
        directory = appdirs.site_config_dir(self.appname, self.appauthor,
                             version=self.version, multipath=self.multipath)
        if self.create:
            self._ensure_directory_exists(directory)
        return directory
1064152
protected function guessBinDir(): string
    {
        $defaultBinDir = $this->config->getBinDir();
        if (!$this->composer()->hasConfiguration()) {
            return $defaultBinDir;
        }

        $config = $this->composer()->getConfiguration();
        if (!$config->has('bin-dir')) {
            return $defaultBinDir;
        }

        return $config->get('bin-dir', Config::RELATIVE_PATHS);
    }
2105
def get_q_home(env):
    """"""
    q_home = env.get('QHOME')
    if q_home:
        return q_home
    for v in ['VIRTUAL_ENV', 'HOME']:
        prefix = env.get(v)
        if prefix:
            q_home = os.path.join(prefix, 'q')
            if os.path.isdir(q_home):
                return q_home
    if WINDOWS:
        q_home = os.path.join(env['SystemDrive'], r'\q')
        if os.path.isdir(q_home):
            return q_home
    raise RuntimeError('No suitable QHOME.')