Get the default user agent and append the user agent marker if there are any.
760883
private String getDefaultUserAgent(Request<?> request) {
        String userAgentMarker = request.getOriginalRequest().getRequestClientOptions().getClientMarker(RequestClientOptions
                                                                                                            .Marker.USER_AGENT);
        String userAgent = ClientConfiguration.DEFAULT_USER_AGENT;
        if (StringUtils.hasValue(userAgentMarker)) {
            userAgent += " " + userAgentMarker;
        }
        return userAgent;
    }
1203193
public function user_agent($user_agent = NULL)
	{
		if ($user_agent !== NULL)
		{
			$this->_user_agent = $user_agent;
			return $this;
		}
		return $this->_user_agent;
	}
476252
def make_user_agent_string(component=None):
    
    ret = "Invenio-%s (+%s; \"%s\")" % (cfg.get('CFG_VERSION'),
                                        cfg.get('CFG_SITE_URL'), cfg.get('CFG_SITE_NAME'))
    if component:
        ret += " %s" % component
    return ret
974717
private function defaultUserAgent()
    {
        static $defaultAgent;

        if ($defaultAgent === null) {
            $defaultAgent = sprintf('Pletfix/%s curl/%s PHP/%s', Application::VERSION, curl_version()['version'], PHP_VERSION);
        }

        return $defaultAgent;
    }
399828
private String getDefaultBrowserAgent(Context context) {
        String userAgent = "";
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            try {
                userAgent = WebSettings.getDefaultUserAgent(context);
            } catch (Exception ignore) {
                // A known Android issue. Webview packages are not accessible while any updates for chrome is in progress.
                // https://bugs.chromium.org/p/chromium/issues/detail?id=506369
            }
        }
        return userAgent;
    }
1175165
public function getUserAgent()
    {
        if (null === ($ua = $this->getServerValue('http_user_agent'))) {
            $ua = self::DEFAULT_HTTP_USER_AGENT;
            $this->setUserAgent($ua);
        }

        return $ua;
    }
20381
def reset
      self.user_agent         = DEFAULT_USER_AGENT
      self.environment        = DEFAULT_ENVIRONMENT
      self.api_version        = DEFAULT_API_VERSION
      self.server_url         = DEFAULT_SERVER_URL
      self.client_name        = DEFAULT_CLIENT_NAME
      self.client_key         = DEFAULT_CLIENT_KEY
      self.connection_options = DEFAULT_CONNECTION_OPTIONS
      self.middleware         = DEFAULT_MIDDLEWARE
      self.accept             = DEFAULT_ACCEPT
      self
    end
591138
public String getApplicationName() {
    String libraryVersion = getLibraryVersion();

    // We have to do the following since underlying layers often do not appreciate User-Agent
    // provided as a normal header and override it or treat setting "application name" as the only
    // way to append something to User-Agent header.
    StringBuilder sb = new StringBuilder();
    String customUserAgentValue = getUserAgent();
    if (customUserAgentValue != null) {
      sb.append(customUserAgentValue).append(' ');
    }
    if (libraryVersion == null) {
      sb.append(getLibraryName());
    } else {
      sb.append(getLibraryName()).append('/').append(libraryVersion);
    }

    return sb.toString();
  }
45242
def make_user_agent(prefix=None):
    """"""
    prefix = (prefix or platform.platform(terse=1)).strip().lower()
    return "cloudsmith-cli/%(prefix)s cli:%(version)s api:%(api_version)s" % {
        "version": get_cli_version(),
        "api_version": get_api_version(),
        "prefix": prefix,
    }
784452
function defaultResolveUser(source, args, context, info) {
  return (
    get(args, ['userID']) ||
    get(context, ['userID']) ||
    get(info, ['rootValue', 'userID'])
  );
}
126510
def _extract_info_from_useragent(user_agent):
    """"""
    parsed_string = user_agent_parser.Parse(user_agent)
    return {
        'os': parsed_string.get('os', {}).get('family'),
        'browser': parsed_string.get('user_agent', {}).get('family'),
        'browser_version': parsed_string.get('user_agent', {}).get('major'),
        'device': parsed_string.get('device', {}).get('family'),
    }
996823
protected function _getUserAgent()
    {
        $ua = str_replace('%v', self::VERSION, $this->userAgent);
        $ua = str_replace('%m', $this->_getUpdateMethod(), $ua);

        return $ua;
    }
27609
def _get_user_agent(platform=None):
    
    if isinstance(platform, ustr):
        platform = platform.upper()
    return {"chrome": AGENT_CHROME, "edge": AGENT_EDGE, "ios": AGENT_IOS}.get(
        platform, random.choice(AGENT_ALL)
    )
340094
protected function _matchUserAgent()
    {
        $type = self::DEFAULT_BROWSER_TYPE;

        // If we have no identification sequence, just return the default type
        if (empty($this->_config['identification_sequence'])) {
            return $type;
        }

        // Get sequence against which to match
        $sequence = explode(',', $this->_config['identification_sequence']);

        // If a browser type is already configured, push that to the front of the list
        if (null !== ($browserType = $this->getBrowserType())) {
            array_unshift($sequence, $browserType);
        }

        // Append the default browser type to the list if not alread in the list
        if (!in_array($type, $sequence)) {
            $sequence[] = $type;
        }

        // Test each type until we find a match
        foreach ($sequence as $browserType) {
            $browserType = trim($browserType);
            $className   = $this->_getUserAgentDevice($browserType);

            // Attempt to match this device class
            if ($this->_match($className)) {
                $type = $browserType;
                $this->_browserTypeClass[$type] = $className;
                break;
            }
        }

        return $type;
    }
708540
private static URI buildDefaultURI(final String userId) {
        // Construct the default URI for the user ID that is not a URI.
        String userAgentBaseUri = System.getProperty(USER_AGENT_BASE_URI_PROPERTY);
        if (isNullOrEmpty(userAgentBaseUri)) {
            // use the default local user agent base uri
            userAgentBaseUri = DEFAULT_USER_AGENT_BASE_URI;
        }

        final String userAgentUri = userAgentBaseUri + userId;

        LOGGER.trace("Default URI is created for user {}: {}", userId, userAgentUri);
        return URI.create(userAgentUri);
    }
361549
def _get_user_agent_string(self):
        """"""
        uname = platform.uname()
        try:
            lang = locale.getlocale()[0][:2]
        except:
            lang = ''
        py_version = '{0}.{1}.{2}'.format(*sys.version_info)
        return 'internetarchive/{0} ({1} {2}; N; {3}; {4}) Python/{5}'.format(
            __version__, uname[0], uname[-1], lang, self.access_key, py_version)
1267120
public function setDefaults($userAgent = null)
    {
        $this->setDefaultHeaders();
        $this->setDefaultOptions();

        if (!empty($userAgent)) {
            $this->setUserAgent($userAgent);
        } else {
            $this->setUserAgent('chrome');
        }
    }