:param name: Name of the revision of spec, eg latest or v4
    :param http_client: Requests client used for retrieving specs
    :param config: Spec configuration - see Spec.CONFIG_DEFAULTS
    :return: :class:`bravado_core.spec.Spec`
192121
def get_spec(name, http_client=None, config=None):
    
    http_client = http_client or requests_client.RequestsClient()

    def load_spec():
        loader = Loader(http_client)
        return loader.load_spec(build_spec_url(name))

    spec_dict = cache.get_or_set(build_cache_name(name), load_spec, app_settings.ESI_SPEC_CACHE_DURATION)
    config = dict(CONFIG_DEFAULTS, **(config or {}))
    return Spec.from_dict(spec_dict, build_spec_url(name), http_client, config)
127397
def validate(self):
        
        for client in self.clients:
            for key in REQUIRED_KEYS:
                if key not in client:
                    raise MissingConfigValue(key)

            if 'revision_file' not in client:
                client.revision_file = DEFAULT_REVISION_FILEPATH.format(
                    client.key
                )
1273849
def metadata(request, config_loader_path=None, valid_for=None):
    
    conf = get_config(config_loader_path, request)
    metadata = entity_descriptor(conf)
    return HttpResponse(content=text_type(metadata).encode('utf-8'),
                        content_type="text/xml; charset=utf8")
1083251
private Configuration getConfigByName(String name) {
    if (config != null) {
      for (Configuration c : config) {
        if (c != null && c.getStringValue(Parameters.ConcurrentEntityName.ordinal(), "").equals(name)) {
          return c;
        }
      }
    }
    return null;
  }
829549
def matches_requirement(self, req):
        
        # Requirement may contain extras - parse to lose those
        # from what's passed to the matcher
        r = parse_requirement(req)
        scheme = get_scheme(self.metadata.scheme)
        try:
            matcher = scheme.matcher(r.requirement)
        except UnsupportedVersionError:
            # XXX compat-mode if cannot read the version
            logger.warning('could not read version %r - using name only',
                           req)
            name = req.split()[0]
            matcher = scheme.matcher(name)

        name = matcher.key   # case-insensitive

        result = False
        for p in self.provides:
            p_name, p_ver = parse_name_and_version(p)
            if p_name != name:
                continue
            try:
                result = matcher.match(p_ver)
                break
            except UnsupportedVersionError:
                pass
        return result
121518
def get_config(self, config_name, require_ready=True):
        
        if require_ready:
            self.bots.check_configs_ready()
        else:
            self.bots.check_bots_ready()

        return self.configs.get(config_name.lower(), {})
915066
def get_default_config(self):
        
        config = super(HttpdCollector, self).get_default_config()
        config.update({
            'path':     'httpd',
            'urls':     ['localhost http://localhost:8080/server-status?auto']
        })
        return config
504349
def profile_(profile, names, vm_overrides=None, opts=None, **kwargs):
    '''
    
    '''
    client = _get_client()
    if isinstance(opts, dict):
        client.opts.update(opts)
    info = client.profile(profile, names, vm_overrides=vm_overrides, **kwargs)
    return info
1119923
def getConf(cls, settings, options):
        ""
        ports = ['http_port', 'https_port', 'cache_port']
        for port_name in ports:
            port = getattr(settings, port_name.upper(), None)
            # only use the settings ports if the defaults were left unchanged
            default = getattr(defaults, port_name.upper())
            if port and options.get(port_name) == default:
                options[port_name] = port

        _opts = [
            ('key', 'hx_private_key'),
            ('cert', 'hx_certficate'),
            ('wsgi', 'wsgi_application')
        ]
        for opt_name, settings_name in _opts:
            opt = getattr(settings, settings_name.upper(), None)
            if opt:
                options[opt_name] = opt

        if not options['settings']:
            options['settings'] = environ['DJANGO_SETTINGS_MODULE']
        return options
1040388
def compare_and_update_config(config, update_config, changes, namespace=''):
    '''
    
    '''
    if isinstance(config, dict):
        if not update_config:
            if config:
                # the updated config is more valid--report that we are using it
                changes[namespace] = {
                    'new': config,
                    'old': update_config,
                }
            return config
        elif not isinstance(update_config, dict):
            # new config is a dict, other isn't--new one wins
            changes[namespace] = {
                'new': config,
                'old': update_config,
            }
            return config
        else:
            # compare each key in the base config with the values in the
            # update_config, overwriting the values that are different but
            # keeping any that are not defined in config
            for key, value in six.iteritems(config):
                _namespace = key
                if namespace:
                    _namespace = '{0}.{1}'.format(namespace, _namespace)
                update_config[key] = compare_and_update_config(
                    value,
                    update_config.get(key, None),
                    changes,
                    namespace=_namespace,
                )
            return update_config

    elif isinstance(config, list):
        if not update_config:
            if config:
                # the updated config is more valid--report that we are using it
                changes[namespace] = {
                    'new': config,
                    'old': update_config,
                }
            return config
        elif not isinstance(update_config, list):
            # new config is a list, other isn't--new one wins
            changes[namespace] = {
                'new': config,
                'old': update_config,
            }
            return config
        else:
            # iterate through config list, ensuring that each index in the
            # update_config list is the same
            for idx, item in enumerate(config):
                _namespace = '[{0}]'.format(idx)
                if namespace:
                    _namespace = '{0}{1}'.format(namespace, _namespace)
                _update = None
                if len(update_config) > idx:
                    _update = update_config[idx]
                if _update:
                    update_config[idx] = compare_and_update_config(
                        config[idx],
                        _update,
                        changes,
                        namespace=_namespace,
                    )
                else:
                    changes[_namespace] = {
                        'new': config[idx],
                        'old': _update,
                    }
                    update_config.append(config[idx])

            if len(update_config) > len(config):
                # trim any items in update_config that are not in config
                for idx, old_item in enumerate(update_config):
                    if idx < len(config):
                        continue
                    _namespace = '[{0}]'.format(idx)
                    if namespace:
                        _namespace = '{0}{1}'.format(namespace, _namespace)
                    changes[_namespace] = {
                        'new': None,
                        'old': old_item,
                    }
                del update_config[len(config):]
            return update_config

    else:
        if config != update_config:
            changes[namespace] = {
                'new': config,
                'old': update_config,
            }
        return config
1104216
def get_cloudformation_client(service_name, environment_name):
    
    region = service_registry.service_region(service_name)

    if whereami() == 'ec2':
        profile = None
    else:
        profile = get_account_alias(environment_name)

    clients = create_aws_clients(region, profile, 'cloudformation')
    return clients['cloudformation']
955287
public static synchronized IClient getNamedClient(String name, Class<? extends IClientConfig> configClass) {
    	if (simpleClientMap.get(name) != null) {
    	    return simpleClientMap.get(name);
    	}
        try {
            return createNamedClient(name, configClass);
        } catch (ClientException e) {
            throw new RuntimeException("Unable to create client", e);
        }
    }
1020451
def get_customizationspec_ref(si, customization_spec_name):
    '''
    

    '''
    customization_spec_name = si.content.customizationSpecManager.GetCustomizationSpec(name=customization_spec_name)
    return customization_spec_name
230041
def get_last_changed_revision(client, url):
    
    try:
        svn_entries = client.info2(url,
                                   pysvn.Revision(pysvn.opt_revision_kind.head),
                                   recurse=False)
        if not svn_entries:
            raise ReleaseVCSError("svn.info2() returned no results on url %s" % url)
        return svn_entries[0][1].last_changed_rev
    except pysvn.ClientError, ce:
        raise ReleaseVCSError("svn.info2() raised ClientError: %s" % ce)
840856
def config_for(name)
      name = name.to_s
      check_for_changes(name) if auto_check?(name)
      data = get_config_data(name)
      logger.debug "config_for(#{name.inspect}) => #{data.inspect}"
      data
    end
605492
def get_module_config(self, name):
    
    if self.exists("modules"):
      if name in self._json["modules"] and not isinstance(self._json["modules"][name], str):
        return self._json["modules"][name]
    return None
672629
def GetClientConfig(filename):
  """"""
  config_lib.SetPlatformArchContext()
  config_lib.ParseConfigCommandLine()
  context = list(grr_config.CONFIG.context)
  context.append("Client Context")
  deployer = build.ClientRepacker()
  # Disable timestamping so we can get a reproducible and cachable config file.
  config_data = deployer.GetClientConfig(
      context, validate=True, deploy_timestamp=False)
  builder = build.ClientBuilder()
  with open(filename, "w") as fd:
    fd.write(config_data)
    builder.WriteBuildYaml(fd, build_timestamp=False)