Get nginx configuration file path based on `nginx -V` output
    :return: detected nginx configuration file path
548016
def detect_config_path():
    
    try:
        proc = subprocess.Popen(['nginx', '-V'], stderr=subprocess.PIPE)
    except OSError:
        error_exit('Access log file or format was not set and nginx config file cannot be detected. ' +
                   'Perhaps nginx is not in your PATH?')

    stdout, stderr = proc.communicate()
    version_output = stderr.decode('utf-8')
    conf_path_match = re.search(r'--conf-path=(\S*)', version_output)
    if conf_path_match is not None:
        return conf_path_match.group(1)

    prefix_match = re.search(r'--prefix=(\S*)', version_output)
    if prefix_match is not None:
        return prefix_match.group(1) + '/conf/nginx.conf'
    return '/etc/nginx/nginx.conf'
1280460
private function getConfigPath()
    {
        //====================================================================//
        //  Load Module Configuration
        $cfg = Splash::configuration();
        //====================================================================//
        //  Check if Custom Configuration Path is Defined
        $cfgPath = Splash::getLocalPath()."/configuration.json";
        if (isset($cfg->ConfiguratorPath) && is_string($cfg->ConfiguratorPath)) {
            $cfgPath = $cfg->ConfiguratorPath;
        }
        //====================================================================//
        //  Check if Custom Configuration File Exists
        Splash::log()->deb("Try Loading Custom Configuration From: ".$cfgPath);
        if (!is_file($cfgPath)) {
            return false;
        }

        return $cfgPath;
    }
614794
def path(self) -> str:
        

        cfg = json.loads(self._tails_cfg_json)
        return join(cfg['base_dir'], cfg['file'])
1136824
def deploy_webconf():
    
    deployed = []
    log_dir = '/'.join([deployment_root(),'log'])
    #TODO - incorrect - check for actual package to confirm installation
    if webserver_list():
        if env.verbosity:
            print env.host,"DEPLOYING webconf:"
        if not exists(log_dir):
            run('ln -s /var/log log')
        #deploys confs for each domain based on sites app
        if 'apache2' in get_packages():
            deployed += _deploy_webconf('/etc/apache2/sites-available','django-apache-template.txt')
            deployed += _deploy_webconf('/etc/nginx/sites-available','nginx-template.txt')
        elif 'gunicorn' in get_packages():
            deployed += _deploy_webconf('/etc/nginx/sites-available','nginx-gunicorn-template.txt')
        
        if not exists('/var/www/nginx-default'):
            sudo('mkdir /var/www/nginx-default')
        upload_template('woven/maintenance.html','/var/www/nginx-default/maintenance.html',use_sudo=True)
        sudo('chmod ugo+r /var/www/nginx-default/maintenance.html')
    else:
        print env.host,"""WARNING: Apache or Nginx not installed"""
        
    return deployed
630475
def getConfigPath(configFileName = None):
    
    if configFileName != None:
        # Returning the path of the configuration file
        if sys.platform == 'win32':
            return os.path.expanduser(os.path.join('~\\', 'Deepify', configFileName))
        else:
            return os.path.expanduser(os.path.join('~/', '.config', 'Deepify', configFileName))
    else:
        # Returning the path of the configuration folder
        if sys.platform == 'win32':
            return os.path.expanduser(os.path.join('~\\', 'Deepify'))
        else:
            return os.path.expanduser(os.path.join('~/', '.config', 'Deepify'))
737335
def parse_config_path(args=sys.argv):
    

    config = CONFIG_PATH
    if '--config' in args:
        idx = args.index('--config')
        if len(args) > idx + 1:
            config = args.pop(idx + 1)
        args.pop(idx)
    return config
1183360
def get_conf_path(filename=None):
    """"""
    # Define conf_dir
    if running_under_pytest() or SAFE_MODE:
        # Use clean config dir if running tests or the user requests it.
        conf_dir = get_clean_conf_dir()
    elif sys.platform.startswith('linux'):
        # This makes us follow the XDG standard to save our settings
        # on Linux, as it was requested on Issue 2629
        xdg_config_home = os.environ.get('XDG_CONFIG_HOME', '')
        if not xdg_config_home:
            xdg_config_home = osp.join(get_home_dir(), '.config')
        if not osp.isdir(xdg_config_home):
            os.makedirs(xdg_config_home)
        conf_dir = osp.join(xdg_config_home, SUBFOLDER)
    else:
        conf_dir = osp.join(get_home_dir(), SUBFOLDER)

    # Create conf_dir
    if not osp.isdir(conf_dir):
        if running_under_pytest() or SAFE_MODE:
            os.makedirs(conf_dir)
        else:
            os.mkdir(conf_dir)
    if filename is None:
        return conf_dir
    else:
        return osp.join(conf_dir, filename)
363558
def discover_config(opts)
      cwd = Dir.pwd.split(File::SEPARATOR)
      detected_path = ""
      until cwd.empty? || File.exists?(detected_path.to_s)
        detected_path = Dir.glob(
          (cwd + ["#{CONFIG_BASE_NAME}{#{VALID_CONFIG_EXTENSIONS.join(",")}}"]).join(
            File::SEPARATOR
          )
        ).first
        cwd.pop
      end
      if opts.respond_to?(:fetch_option)
        opts.fetch_option("config").value = detected_path if detected_path
      else
        opts["config"] = detected_path if detected_path
      end
      opts
    end
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)
440516
def get_default_config_file(rootdir=None):
    """"""
    if rootdir is None:
        return DEFAULT_CONFIG_FILE

    for path in CONFIG_FILES:
        path = os.path.join(rootdir, path)
        if os.path.isfile(path) and os.access(path, os.R_OK):
            return path
465999
function getPath( req, res, next ) {

	var path = req.path.replace( /\..*$/, '' ).replace( /\//g, '.' ).replace( /^\.conf/, '' ).replace( /\.$/, '' ).trim();

	if ( path.length < 1 ) {
		path = null;
	}

	var outputFilter = req.path.trim().match( /\.(.*)$/ );
	if ( outputFilter ) {
		outputFilter = outputFilter[1].trim();
	}

	if ( typeof outputFilter !== 'string' || outputFilter.length < 1 ) {
		outputFilter = 'json';
	}

	req.confPath = path;
	req.outputFilter = outputFilter;

	return next();

}
1258863
def _get_full_paths(fastq_dir, config, config_file):
    
    if fastq_dir:
        fastq_dir = utils.add_full_path(fastq_dir)
    config_dir = utils.add_full_path(os.path.dirname(config_file))
    galaxy_config_file = utils.add_full_path(config.get("galaxy_config", "universe_wsgi.ini"),
                                             config_dir)
    return fastq_dir, os.path.dirname(galaxy_config_file), config_dir
195846
def _get_config_dirs(self):
        
        _cwd = os.path.split(os.path.abspath(__file__))[0]
        _pdir = os.path.split(_cwd)[0]
        _etcdir = ''.join((_pdir, '/', 'etc/'))
        cfg_dirs = [
            self._fixpath(_cwd),
            self._fixpath('/etc/zvmsdk/'),
            self._fixpath('/etc/'),
            self._fixpath('~'),
            self._fixpath(_etcdir),
        ]
        return [x for x in cfg_dirs if x]
573266
def _find_file(self, load):
        '''
        
        '''
        path = load.get('path')
        if not path:
            return {'path': '',
                    'rel': ''}
        tgt_env = load.get('saltenv', 'base')
        return self.find_file(path, tgt_env)
932321
def get_config_file():
    # type: () -> AnyStr
    """"""
    parser = argparse.ArgumentParser(description="Read configuration file.")
    parser.add_argument('-ini', help="Full path of configuration file")
    args = parser.parse_args()
    ini_file = args.ini
    if not FileClass.is_file_exists(ini_file):
        print("Usage: -ini <full path to the configuration file.>")
        exit(-1)
    return ini_file
493325
def config():
    
    cfg = ConfigParser()
    cfg.read(os.path.join(os.path.dirname(os.path.realpath(ips_vagrant.__file__)), 'config/ipsv.conf'))
    return cfg
719140
def get_log_path(config_file_name):
    ''''''
    stdout_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stdout')
    stderr_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stderr')
    return stdout_full_path, stderr_full_path