Get the JVM options for ivy authentication, if needed.
322519
def _ivy_jvm_options(self, repo):
    """"""
    # Get authentication for the publish repo if needed.
    if not repo.get('auth'):
      # No need to copy here, as this list isn't modified by the caller.
      return self._jvm_options

    # Create a copy of the options, so that the modification is appropriately transient.
    jvm_options = copy(self._jvm_options)
    user = repo.get('username')
    password = repo.get('password')
    if user and password:
      jvm_options.append('-Dlogin={}'.format(user))
      jvm_options.append('-Dpassword={}'.format(password))
    else:
      raise TaskError('Unable to publish to {}. {}'
                      .format(repo.get('resolver'), repo.get('help', '')))
    return jvm_options
943598
def get_options(server):
    """"""
    try:
        response = requests.options(
            server, allow_redirects=False, verify=False, timeout=5)
    except (requests.exceptions.ConnectionError,
            requests.exceptions.MissingSchema):
        return "Server {} is not available!".format(server)

    try:
        return {'allowed': response.headers['Allow']}
    except KeyError:
        return "Unable to get HTTP methods"
1070519
@Override
    public String[] getjavaVMs() {
        final String methodName = "getjavaVMs";
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(tc, methodName, this);

        ArrayList<String> jvmArrayList = new ArrayList<String>();
        ObjectName obnToFind = null;//WebSphere:name=JVM,J2EEServer=com.ibm.ws.jca.jdbc.mbean.fat,j2eeType=JVM
        final String obnStr = "WebSphere:j2eeType=JVM,*";
        final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
        try {
            obnToFind = new ObjectName(obnStr);
        } catch (MalformedObjectNameException e) {
            //Should never happen because we are building the ObjectName without any user input
            if (trace && tc.isDebugEnabled())
                Tr.debug(tc, "Unable to create ObjectName with the string: " + obnStr, e);
        }
        Set<ObjectInstance> matchingMbeanList = mbs.queryMBeans(obnToFind, null);
        if (matchingMbeanList.size() == 0) {
            if (trace && tc.isDebugEnabled())
                Tr.debug(tc, methodName + ": matchingMbeanList.size(): " + matchingMbeanList.size()
                             + ", We didn't find any Mbean matching: " + obnStr);
            if (trace && tc.isEntryEnabled())
                Tr.exit(tc, methodName, this);
            return null;
        } else {
            for (ObjectInstance bean : matchingMbeanList) {
                if (trace && tc.isDebugEnabled())
                    Tr.debug(tc, "**  Found a matching MBean: " + bean.getObjectName().toString());
                jvmArrayList.add(bean.getObjectName().toString());
            }
        }

        if (trace && tc.isEntryEnabled())
            Tr.exit(tc, methodName, this);

        return jvmArrayList.toArray(new String[jvmArrayList.size()]);
    }
810186
def optionsFromEnvironment(defaults=None):
    """"""
    options = defaults or {}
    credentials = options.get('credentials', {})

    rootUrl = os.environ.get('TASKCLUSTER_ROOT_URL')
    if rootUrl:
        options['rootUrl'] = rootUrl

    clientId = os.environ.get('TASKCLUSTER_CLIENT_ID')
    if clientId:
        credentials['clientId'] = clientId

    accessToken = os.environ.get('TASKCLUSTER_ACCESS_TOKEN')
    if accessToken:
        credentials['accessToken'] = accessToken

    certificate = os.environ.get('TASKCLUSTER_CERTIFICATE')
    if certificate:
        credentials['certificate'] = certificate

    if credentials:
        options['credentials'] = credentials

    return options
944145
def get_kvm_archs():
        
        kvm = []

        if not os.path.exists("/dev/kvm"):
            return kvm

        arch = platform.machine()
        if arch == "x86_64":
            kvm.append("x86_64")
            kvm.append("i386")
        elif arch == "i386":
            kvm.append("i386")
        else:
            kvm.append(platform.machine())
        return kvm
855511
public static Options getOptions() {
		final Options options = new Options();

		options.addOption(CLI_OPTION_CLASSPATH_SHORT, CLI_OPTION_CLASSPATH_LONG, true,
				Messages.Boot_24);

		options.addOption(CLI_OPTION_EMBEDDED_SHORT, CLI_OPTION_EMBEDDED_LONG, false,
				Messages.Boot_5);

		options.addOption(CLI_OPTION_BOOTID_SHORT, CLI_OPTION_BOOTID_LONG, false,
				MessageFormat.format(Messages.Boot_6,
						JanusConfig.BOOT_DEFAULT_CONTEXT_ID_NAME, JanusConfig.RANDOM_DEFAULT_CONTEXT_ID_NAME));

		options.addOption(CLI_OPTION_FILE_SHORT, CLI_OPTION_FILE_LONG, true,
				Messages.Boot_7);

		options.addOption(CLI_OPTION_HELP_SHORT, CLI_OPTION_HELP_LONG, false,
				Messages.Boot_8);

		options.addOption(null, CLI_OPTION_NOLOGO_LONG, false,
				Messages.Boot_9);

		options.addOption(CLI_OPTION_OFFLINE_SHORT, CLI_OPTION_OFFLINE_LONG, false,
				MessageFormat.format(Messages.Boot_10, JanusConfig.OFFLINE));

		options.addOption(CLI_OPTION_QUIET_SHORT, CLI_OPTION_QUIET_LONG, false,
				Messages.Boot_11);

		options.addOption(CLI_OPTION_RANDOMID_SHORT, CLI_OPTION_RANDOMID_LONG, false,
				MessageFormat.format(Messages.Boot_12,
						JanusConfig.BOOT_DEFAULT_CONTEXT_ID_NAME, JanusConfig.RANDOM_DEFAULT_CONTEXT_ID_NAME));

		options.addOption(CLI_OPTION_SHOWDEFAULTS_SHORT, CLI_OPTION_SHOWDEFAULTS_LONG, false,
				Messages.Boot_13);

		options.addOption(CLI_OPTION_SHOWCLASSPATH, false,
				Messages.Boot_23);

		options.addOption(null, CLI_OPTION_SHOWCLIARGUMENTS_LONG, false,
				Messages.Boot_14);

		options.addOption(CLI_OPTION_VERBOSE_SHORT, CLI_OPTION_VERBOSE_LONG, false,
				Messages.Boot_15);

		options.addOption(CLI_OPTION_VERSION, false,
				Messages.Boot_25);

		options.addOption(CLI_OPTION_WORLDID_SHORT, CLI_OPTION_WORLDID_LONG, false,
				MessageFormat.format(Messages.Boot_16,
						JanusConfig.BOOT_DEFAULT_CONTEXT_ID_NAME, JanusConfig.RANDOM_DEFAULT_CONTEXT_ID_NAME));
		final StringBuilder b = new StringBuilder();
		int level = 0;
		for (final String logLevel : LoggerCreator.getLevelStrings()) {
			if (b.length() > 0) {
				b.append(", "); //$NON-NLS-1$
			}
			b.append(logLevel);
			b.append(" ("); //$NON-NLS-1$
			b.append(level);
			b.append(")"); //$NON-NLS-1$
			++level;
		}
		Option opt = new Option(CLI_OPTION_LOG_SHORT, CLI_OPTION_LOG_LONG, true,
				MessageFormat.format(Messages.Boot_17,
						JanusConfig.VERBOSE_LEVEL_VALUE, b));
		opt.setArgs(1);
		options.addOption(opt);
		opt = new Option(CLI_OPTION_DEFINE_SHORT, CLI_OPTION_DEFINE_LONG, true,
				Messages.Boot_18);
		opt.setArgs(2);
		opt.setValueSeparator('=');
		opt.setArgName(Messages.Boot_19);
		options.addOption(opt);
		return options;
	}
1112804
public List<String> getJavas(SlaveComputer computer, TaskListener listener, Connection connection) {
        return getJavas(listener,connection);
    }
1211361
LoggingOptions getLoggingOptions() {
    if (loggingOptions == null) {
      if (Strings.isNullOrEmpty(credentialsFile)) {
        loggingOptions = LoggingOptions.getDefaultInstance();
      } else {
        try {
          loggingOptions =
              LoggingOptions.newBuilder()
                  .setCredentials(
                      GoogleCredentials.fromStream(new FileInputStream(credentialsFile)))
                  .build();
        } catch (IOException e) {
          throw new RuntimeException(
              String.format(
                  "Could not read credentials file %s. Please verify that the file exists and is a valid Google credentials file.",
                  credentialsFile),
              e);
        }
      }
    }
    return loggingOptions;
  }
599658
def execute(self, jvm_options=None, args=None, executor=None,
              workunit_factory=None, workunit_name=None, workunit_labels=None):
    
    # NB(gmalmquist): It should be OK that we can't declare a subsystem_dependency in this file
    # (because it's just a plain old object), because Ivy is only constructed by Bootstrapper, which
    # makes an explicit call to IvySubsystem.global_instance() in its constructor, which in turn has
    # a declared dependency on DistributionLocator.
    executor = executor or SubprocessExecutor(DistributionLocator.cached())
    runner = self.runner(jvm_options=jvm_options, args=args, executor=executor)
    try:
      with self.resolution_lock:
        result = util.execute_runner(runner, workunit_factory, workunit_name, workunit_labels)
      if result != 0:
        raise self.Error('Ivy command failed with exit code {}{}'.format(
                           result, ': ' + ' '.join(args) if args else ''))
    except executor.Error as e:
      raise self.Error('Problem executing ivy: {}'.format(e))
758990
private ConfigurationProvider locateConfigurationProvider() {
        if (configurationProvider == null)
            return new IvyConfigurationProvider(options.isOffline(), options.isVerbose());
        else
            return configurationProvider;
    }
219108
def get_keypair(vm_):
    '''
    
    '''
    keypair = config.get_cloud_config_value('keypair', vm_, __opts__)

    if keypair:
        return keypair
    else:
        return False
330030
def execute(self):
    
    if JvmResolveSubsystem.global_instance().get_options().resolver != 'ivy':
      return

    compile_classpath = self.context.products.get_data('compile_classpath',
        init_func=ClasspathProducts.init_func(self.get_options().pants_workdir))

    targets = self.context.targets()
    if all(not isinstance(target, JarLibrary) for target in targets):
      if self._report:
        self.context.log.info("Not generating a report. No resolution performed.")
      return

    executor = self.create_java_executor()
    results = self.resolve(executor=executor,
                                      targets=targets,
                                      classpath_products=compile_classpath,
                                      confs=self.get_options().confs,
                                      extra_args=self._args)
    if self._report:
      results_with_resolved_artifacts = [r for r in results if r.has_resolved_artifacts]

      if not results_with_resolved_artifacts:
        self.context.log.info("Not generating a report. No resolution performed.")
      else:
        for result in results_with_resolved_artifacts:
          self._generate_ivy_report(result)
254975
def _get_java_env(self):
        ""
        env = super(_StreamingAnalyticsSubmitter, self)._get_java_env()
        vcap = streamsx.rest._get_vcap_services(self._vcap_services)
        env['VCAP_SERVICES'] = json.dumps(vcap)
        return env
511239
def get_options(config=None):
    """"""
    if config is None:
        from . import config
        config.get = lambda key, default=None: getattr(config, key, default)

    base = {
        "components": config.get("COMPONENTS"),
        "signatures": config.get("SIGNATURES"),
        "commit_msg_template": config.get("COMMIT_MSG_TEMPLATE"),
        "commit_msg_labels": config.get("COMMIT_MSG_LABELS"),
        "alt_signatures": config.get("ALT_SIGNATURES"),
        "trusted": config.get("TRUSTED_DEVELOPERS"),
        "pep8": config.get("CHECK_PEP8", True),
        "pydocstyle": config.get("CHECK_PYDOCSTYLE", True),
        "license": config.get("CHECK_LICENSE", True),
        "pyflakes": config.get("CHECK_PYFLAKES", True),
        "ignore": config.get("IGNORE"),
        "select": config.get("SELECT"),
        "match": config.get("PYDOCSTYLE_MATCH"),
        "match_dir": config.get("PYDOCSTYLE_MATCH_DIR"),
        "min_reviewers": config.get("MIN_REVIEWERS"),
        "colors": config.get("COLORS", True),
        "excludes": config.get("EXCLUDES", []),
        "authors": config.get("AUTHORS"),
        "exclude_author_names": config.get("EXCLUDE_AUTHOR_NAMES"),
    }
    options = {}
    for k, v in base.items():
        if v is not None:
            options[k] = v
    return options
143493
private Properties getGlobalLoginBasicProps() throws Exception {
        String realm = getWebAppSecurityConfig().getBasicAuthRealmName();
        Properties props = new Properties();
        if (realm == null) {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "basicAuthenticationMechanismRealmName is not set. the default value " + JavaEESecConstants.DEFAULT_REALM + " is used.");
            }
        } else {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "The container provided BasicAuthenticationMechanism will be used with the realm name  : " + realm);
            }
            props.put(JavaEESecConstants.REALM_NAME, realm);
        }
        return props;
    }
1078938
def get_configuration(self, uri):
        '''
        
        '''

        req_headers = {
            'Accept': 'application/vnd.onshape.v1+json',
            'Content-Type': 'application/json'
        }
        return self._api.request('get', '/api/partstudios/d/' + uri["did"] + '/' + uri["wvm_type"] + '/' + uri["wvm"] + '/e/' + uri["eid"] + '/configuration', headers=req_headers)
673530
def _get_possible_adapter_modes(interface, blacklist):
    '''
    
    '''
    adapter_modes = []
    protocols = _load_config('lvrt', ['AdditionalNetworkProtocols'])['AdditionalNetworkProtocols'].lower()
    sys_interface_path = os.readlink('/sys/class/net/{0}'.format(interface))
    with salt.utils.files.fopen('/sys/class/net/{0}/uevent'.format(interface)) as uevent_file:
        uevent_lines = uevent_file.readlines()
    uevent_devtype = ""
    for line in uevent_lines:
        if line.startswith("DEVTYPE="):
            uevent_devtype = line.split('=')[1].strip()
            break

    for adapter_mode in blacklist:
        if adapter_mode == '_':
            continue
        value = blacklist.get(adapter_mode, {})
        if value.get('additional_protocol') and adapter_mode not in protocols:
            continue

        if interface not in value['name'] \
            and not any((blacklist['_'][iface_type] == 'sys' and iface_type in sys_interface_path) or
                        (blacklist['_'][iface_type] == 'uevent' and iface_type == uevent_devtype)
                        for iface_type in value['type']):
            adapter_modes += [adapter_mode]
    return adapter_modes