Creates a new UserAgent with the given configuration; the UserAgent must be started.

@param settings the configuration for the UserAgent
@return a new UserAgent with the given configuration
540676
public static UserAgent newUserAgent(Settings settings)
    {
        UserAgent.Factory factory = Factories.newInstance(settings, Keys.UA_FACTORY_KEY);
        return factory.newUserAgent(settings);
    }
1185055
public static WebDriver getFirefoxDriverWithJSSettings(
			final String userAgent, final boolean javascriptEnabled) {
		FirefoxProfile profile = new FirefoxProfile();
		profile.setPreference("general.useragent.override", userAgent);
		profile.setPreference("javascript.enabled", javascriptEnabled);
		WebDriver driver = new FirefoxDriver(profile);
		return driver;

	}
171153
public Agent newAgent(Agent a) {
	Agent res = newAgent(a.getId());
	res.getType().addAll(a.getType());
	res.getLabel().addAll(a.getLabel());
	return res;
    }
186599
public JFeatureExtractor<T> extractWithSettings(List<T> input, String settings) {
    return new JFeatureExtractor<>(JavaOps.extractWithSettings(self, input, settings));
  }
132200
public static AndroidHttpClient newInstance(String userAgent) {
    HttpParams params = new BasicHttpParams();

    // Turn off stale checking. Our connections break all the time anyway,
    // and it's not worth it to pay the penalty of checking every time.
    HttpConnectionParams.setStaleCheckingEnabled(params, false);

    // Default connection and socket timeout of 20 seconds. Tweak to taste.
    HttpConnectionParams.setConnectionTimeout(params, 20 * 1000);
    HttpConnectionParams.setSoTimeout(params, 20 * 1000);
    HttpConnectionParams.setSocketBufferSize(params, 8192);

    // Don't handle redirects -- return them to the caller. Our code
    // often wants to re-POST after a redirect, which we must do ourselves.
    HttpClientParams.setRedirecting(params, false);

    // Set the specified user agent and register standard protocols.
    HttpProtocolParams.setUserAgent(params, userAgent);
    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
    schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
    ClientConnectionManager manager = new ThreadSafeClientConnManager(params, schemeRegistry);

    // We use a factory method to modify superclass initialization
    // parameters without the funny call-a-static-method dance.
    return new AndroidHttpClient(manager, params);
  }
334312
private RequestConfig createDefaultRequestConfig(HttpSettings settings) {
        int connectionTimeout = settings.getConnectionTimeout();
        int socketTimeout = settings.getReadTimeout();
        return RequestConfig.custom().setConnectionRequestTimeout(connectionTimeout).setSocketTimeout(socketTimeout).build();
    }
686745
public void setUserAgent(String userAgent) {
        this.userAgent = userAgent.toLowerCase();

        // Re-order the set
        Set<UserAgentDirectives> replace = new TreeSet<UserAgentDirectives>(
            new UserAgentDirectives.UserAgentComparator(this.userAgent));
        replace.addAll(rules);
        rules = replace;
    }
1218111
def _create_user_agent(self):
        
        user_agent = '{}/{} {}'.format(pyspacegdn.__title__,
                                       pyspacegdn.__version__,
                                       default_user_agent())
        if self.client_name:
            user_agent = '{}/{} {}'.format(self.client_name,
                                           self.client_version, user_agent)
        return user_agent
465747
public WalletAppKit setUserAgent(String userAgent, String version) {
        this.userAgent = checkNotNull(userAgent);
        this.version = checkNotNull(version);
        return this;
    }
728321
public App addAllSettings(Map<String, Object> settings) {
		// add the new settings one at a time so the add setting listeners are invoked
		if (settings != null && !settings.isEmpty()) {
			for (Map.Entry<String, Object> iter : settings.entrySet()) {
				addSetting(iter.getKey(), iter.getValue());
			}
		}
		return this;
	}
1288548
public JRecordExtractor<T, Example>
  extractWithSubsetSettingsExample(String settings) {
    return new JRecordExtractor<>(JavaOps.extractWithSubsetSettingsExample(self, settings));
  }
240285
function (settings) {
    this.key = settings && settings.key;
    this.userId = settings && settings.userId;
    this.username = settings && settings.username;
    return this;
  }
612816
public Agent newAgent(QualifiedName id, Collection<Attribute> attributes) {
	Agent res = newAgent(id);
	setAttributes(res, attributes);
	return res;
    }
911800
@RequestMapping(value = "configurations/create", method = RequestMethod.POST)
    public JIRAConfiguration newConfiguration(@RequestBody JIRAConfiguration configuration) {
        return jiraConfigurationService.newConfiguration(configuration);
    }
30673
private void setDefaultUserAgent() {
        setUserAgent(
                MwsUtl.escapeAppName(applicationName),
                MwsUtl.escapeAppVersion(applicationVersion),
                MwsUtl.escapeAttributeValue("Java/"
                        + System.getProperty("java.version") + "/"
                        + System.getProperty("java.class.version") + "/"
                        + System.getProperty("java.vendor")),

                MwsUtl.escapeAttributeName("Platform"),
                MwsUtl.escapeAttributeValue("" + System.getProperty("os.name")
                        + "/" + System.getProperty("os.arch") + "/"
                        + System.getProperty("os.version")),

                MwsUtl.escapeAttributeName("MWSClientVersion"),
                MwsUtl.escapeAttributeValue(libraryVersion));
    }
1205537
public static HttpClientContext newClientContext(HttpClientSettings settings,
                                                     Map<String, ? extends Object>
                                                             attributes) {
        final HttpClientContext clientContext = new HttpClientContext();

        if (attributes != null && !attributes.isEmpty()) {
            for (Map.Entry<String, ?> entry : attributes.entrySet()) {
                clientContext.setAttribute(entry.getKey(), entry.getValue());
            }
        }

        addPreemptiveAuthenticationProxy(clientContext, settings);

        clientContext.setAttribute(HttpContextUtils.DISABLE_SOCKET_PROXY_PROPERTY, settings.disableSocketProxy());
        return clientContext;

    }
135544
public static PropertiesConfigurationSource create(Reader reader, int priority)
      throws ConfigurationException, IOException {
    return new PropertiesConfigurationSource(createPropertiesConfiguration(reader), priority);
  }