Returns current project server config. Copied from original LiveDevelopment.
495567
function getCurrentProjectServerConfig() {
        return {
            baseUrl: ProjectManager.getBaseUrl(),
            pathResolver: ProjectManager.makeProjectRelativeIfPossible,
            root: ProjectManager.getProjectRoot().fullPath
        };
    }
459317
def get_default_config(self):
        
        config = super(HAProxyCollector, self).get_default_config()
        config.update({
            'method':           'http',
            'path':             'haproxy',
            'url':              'http://localhost/haproxy?stats;csv',
            'user':             'admin',
            'pass':             'password',
            'sock':             '/var/run/haproxy.sock',
            'ignore_servers':   False,
        })
        return config
1174670
def get_default_project_directory():
    

    server_config = Config.instance().get_section_config("Server")
    path = os.path.expanduser(server_config.get("projects_path", "~/GNS3/projects"))
    path = os.path.normpath(path)
    try:
        os.makedirs(path, exist_ok=True)
    except OSError as e:
        raise aiohttp.web.HTTPInternalServerError(text="Could not create project directory: {}".format(e))
    return path
954106
public function getConfiguration() {
    if ($this->getLocalPackage() === NULL) {
      $reader = new ConfigurationReader();

      // see ProjectsFactory
      return $reader->fromArray(
        $this->getHostConfiguration()->get(array('defaults'), array())
      );
    }
    
    return $this->getLocalProject()->getConfiguration();
  }
949389
def config_server
      file = File.open("#{@project_name}/server.rb", "r+")
      file.each do |line|	   
        while line == "  def response(env)\n" do
          pos = file.pos
          rest = file.read
          file.seek pos
          file.write("\t::") 
          file.write(@module_name)
          file.write("::Base.call(env)\n")
          file.write(rest)
          $stdout.puts "\e[1;35m \tconfig\e[0m\tserver.rb"
          return
        end
      end
    end
45801
def _get_session(server):
    '''
    
    '''
    if server in _sessions:
        return _sessions[server]

    config = _get_spacewalk_configuration(server)
    if not config:
        raise Exception('No config for \'{0}\' found on master'.format(server))

    session = _get_client_and_key(config['api_url'], config['username'], config['password'])
    atexit.register(_disconnect_session, session)

    client = session['client']
    key = session['key']
    _sessions[server] = (client, key)

    return client, key
153465
def get_default_config(self):
        
        config = super(NetscalerSNMPCollector, self).get_default_config()
        config.update({
            'path':     'netscaler',
            'timeout':  15,
            'exclude_service_type': [],
            'exclude_vserver_type': [],
            'exclude_service_state': [],
            'exclude_vserver_state': []
        })
        return config
498572
def get_default_config(self):
        
        config = super(SentryHandler, self).get_default_config()

        config.update({
            'dsn': '',
        })

        return config
1099181
private function getServerConfig() {

		$this->server['apc_on'] = extension_loaded('apc') && function_exists('apc_add') && ini_get('apc.enabled') && ini_get('apc.rfc1867');

		$fs = ini_get('upload_max_filesize');
		$suffix = strtoupper(substr($fs, -1));
		switch($suffix) {
			case 'K':
				$mult = 1024; break;
			case 'M':
				$mult = 1024*1024; break;
			case 'G':
				$mult = 1024*1024*1024; break;
			default:
				$mult = 0;
		}

		$this->server['max_upload_filesize'] = $mult ? (float) (substr($fs, 0, -1)) * $mult : (int) $fs;

	}
530573
def configure_server():
    '''
    
    '''

    home = os.path.expanduser('~')
    if os.path.isfile(os.path.join(home, '.transfer', 'config.yaml')):
        with open(os.path.join(home, '.transfer', 'config.yaml'), 'r') as fp:
            config = yaml.load(fp.read())
    else:
        config = []

    project_name = input('Name your project: ')
    existing_project = None
    for project in config:
        if project_name == project['name']:
            existing_project = project_name
    if existing_project is not None:
        print(colored('Project ' + project_name + ' already exists', 'red'))
        overwrite = str_input('Would you like to overwrite this project? (yes or no) ', ['yes', 'no'])
        if overwrite == 'no':
            return
        else:
            config = [project for project in config if project_name != project['name']]

    api_port = int_input('port for local prediction API (suggested: 5000)', 1024, 49151)
    print('Select image resolution:')
    print('[0] low (224 px)')
    print('[1] mid (448 px)')
    print('[2] high (896 px)')
    img_resolution_index = int_input('choice', 0, 2, show_range = False)
    if img_resolution_index == 0:
        img_size = 1
    elif img_resolution_index == 1:
        img_size = 2
    else:
        img_size = 4
    num_categories = int_input('number of image categories in your model', 0, 10000000)

    weights = False
    while weights == False:
        server_weights = os.path.expanduser(input('Select weights file: '))
        if os.path.isfile(server_weights):
            weights = True
        else:
            print('Cannot find the weight file: ', server_weights)

    project = {'name': project_name,
               'api_port': api_port,
               'img_size': img_size,
               'number_categories': num_categories,
               'server_weights': server_weights}

    config.append(project)
    store_config(config)
    print('')
    print(colored('Project configure saved!', 'cyan'))
    print('')
    print('To start the server:')
    print('')
    print(colored('    transfer --prediction-rest-api --project ' + project_name, 'green'))
    print('or')
    print(colored('    transfer --prediction-rest-api -p ' + project_name, 'green'))
871106
protected String getCurrentProjectVersion() throws MojoFailureException {
        final Model model = readModel(mavenSession.getCurrentProject());
        if (model.getVersion() == null) {
            throw new MojoFailureException(
                    "Cannot get current project version. This plugin should be executed from the parent project.");
        }
        return model.getVersion();
    }
693888
def get_default_config(self):
        
        config = super(SlonyCollector, self).get_default_config()
        config.update({
            'path': 'postgres',
            'host': 'localhost',
            'user': 'postgres',
            'password': 'postgres',
            'port': 5432,
            'slony_node_string': 'Node [0-9]+ - postgres@localhost',
            'method': 'Threaded',
            'instances': {},
        })
        return config
158473
def default_endpoint_from_config(config, option=None):
    """"""
    default_endpoint = config.get('core', {}).get('default')
    project_endpoint = config.get('project',
                                  {}).get('core',
                                          {}).get('default', default_endpoint)
    return Endpoint(
        option or project_endpoint or default_endpoint,
        default=default_endpoint,
        project=project_endpoint,
        option=option
    )
708236
public String getProject(String configString) {
    if (configString == null
        || configString.trim().isEmpty()
        || configString.equals(APPENGINE_CONFIG)) {
      throw new GradleException(PROJECT_ERROR);
    }
    if (configString.equals(GCLOUD_CONFIG)) {
      try {
        String gcloudProject = cloudSdkOperations.getGcloud().getConfig().getProject();
        if (gcloudProject == null || gcloudProject.trim().isEmpty()) {
          throw new GradleException("Project was not found in gcloud config");
        }
        return gcloudProject;
      } catch (IOException
          | CloudSdkOutOfDateException
          | ProcessHandlerException
          | CloudSdkNotFoundException
          | CloudSdkVersionFileException ex) {
        throw new GradleException("Failed to read project from gcloud config", ex);
      }
    }
    return configString;
  }
494144
def get_current_semver(data):
    """"""
    # get the not-none values from data
    known = {
        key: data.get(alias)
        for key, alias in config._forward_aliases.items()
        if data.get(alias) is not None
    }

    # prefer the strict field, if available
    potentials = [
        known.pop(Constants.VERSION_STRICT_FIELD, None),
        known.pop(Constants.VERSION_FIELD, None),
    ]

    from_components = [known.get(k) for k in SemVerSigFig._fields if k in known]
    if len(from_components) == 3:
        potentials.append(".".join(from_components))

    versions = set()
    for potential in potentials:
        if not potential:
            continue
        match = re_semver.match(potential)
        if match:
            parts = match.groupdict()
            parts.pop("tail")
            versions.add(SemVer(**parts))

    if len(versions) > 1:
        raise ValueError("conflicting versions within project: %s" % versions)

    if not versions:
        _LOG.debug("key pairs found: \n%r", known)
        raise ValueError("could not find existing semver")
    return versions.pop()
1200063
def get_default_config(self):
        
        config = super(zmqHandler, self).get_default_config()

        config.update({
            'port': 1234,
        })

        return config
741649
def persist_project(project):
    
    from benchbuild.utils.schema import Project, Session
    session = Session()
    projects = session.query(Project) \
        .filter(Project.name == project.name) \
        .filter(Project.group_name == project.group)

    name = project.name
    desc = project.__doc__
    domain = project.domain
    group_name = project.group
    version = project.version() \
        if callable(project.version) else project.version
    try:
        src_url = project.src_uri
    except AttributeError:
        src_url = 'unknown'

    if projects.count() == 0:
        newp = Project()
        newp.name = name
        newp.description = desc
        newp.src_url = src_url
        newp.domain = domain
        newp.group_name = group_name
        newp.version = version
        session.add(newp)
    else:
        newp_value = {
            "name": name,
            "description": desc,
            "src_url": src_url,
            "domain": domain,
            "group_name": group_name,
            "version": version
        }
        projects.update(newp_value)

    session.commit()
    return (projects, session)