Get our default blockstack RESTful API opts from a config file,
   or from sane defaults.
489083
def default_blockstack_api_opts(working_dir, config_file=None):
   

   from .util import url_to_host_port, url_protocol

   if config_file is None:
      config_file = virtualchain.get_config_filename(get_default_virtualchain_impl(), working_dir)

   parser = SafeConfigParser()
   parser.read(config_file)

   blockstack_api_opts = {}
   indexer_url = None
   api_port = DEFAULT_API_PORT
   api_host = DEFAULT_API_HOST
   run_api = True

   if parser.has_section('blockstack-api'):
      if parser.has_option('blockstack-api', 'enabled'):
          run_api = parser.get('blockstack-api', 'enabled').lower() in ['true', '1', 'on']

      if parser.has_option('blockstack-api', 'api_port'):
          api_port = int(parser.get('blockstack-api', 'api_port'))

      if parser.has_option('blockstack-api', 'api_host'):
          api_host = parser.get('blockstack-api', 'api_host')

      if parser.has_option('blockstack-api', 'indexer_url'):
          indexer_host, indexer_port = url_to_host_port(parser.get('blockstack-api', 'indexer_url'))
          indexer_protocol = url_protocol(parser.get('blockstack-api', 'indexer_url'))
          if indexer_protocol is None:
              indexer_protocol = 'http'

          indexer_url = parser.get('blockstack-api', 'indexer_url')

   if indexer_url is None:
       # try defaults
       indexer_url = 'http://localhost:{}'.format(RPC_SERVER_PORT)

   blockstack_api_opts = {
        'indexer_url': indexer_url,
        'api_host': api_host,
        'api_port': api_port,
        'enabled': run_api
   }

   # strip Nones
   for (k, v) in blockstack_api_opts.items():
      if v is None:
         del blockstack_api_opts[k]

   return blockstack_api_opts
440516
def get_default_config_file(rootdir=None):
    """"""
    if rootdir is None:
        return DEFAULT_CONFIG_FILE

    for path in CONFIG_FILES:
        path = os.path.join(rootdir, path)
        if os.path.isfile(path) and os.access(path, os.R_OK):
            return path
943500
def load_configuration(working_dir):
    

    import nameset.virtualchain_hooks as virtualchain_hooks

    # acquire configuration, and store it globally
    opts = configure(working_dir)
    blockstack_opts = opts.get('blockstack', None)
    blockstack_api_opts = opts.get('blockstack-api', None)
    bitcoin_opts = opts['bitcoind']

    # config file version check
    config_server_version = blockstack_opts.get('server_version', None)
    if (config_server_version is None or versions_need_upgrade(config_server_version, VERSION)):
       print >> sys.stderr, "Obsolete or unrecognizable config file ({}): '{}' != '{}'".format(virtualchain.get_config_filename(virtualchain_hooks, working_dir), config_server_version, VERSION)
       print >> sys.stderr, 'Please see the release notes for version {} for instructions to upgrade (in the release-notes/ folder).'.format(VERSION)
       return None

    # store options
    set_bitcoin_opts( bitcoin_opts )
    set_blockstack_opts( blockstack_opts )
    set_blockstack_api_opts( blockstack_api_opts )

    return {
        'bitcoind': bitcoin_opts,
        'blockstack': blockstack_opts,
        'blockstack-api': blockstack_api_opts
    }
437365
def get_default_config(self):
        
        config = super(SlabInfoCollector, self).get_default_config()
        config.update({
            'path':     'slabinfo'
        })
        return config
502102
def get_client_settings_config_file(**kwargs):  # pylint: disable=inconsistent-return-statements
    
    config_files = ['/etc/softlayer.conf', '~/.softlayer']
    if kwargs.get('config_file'):
        config_files.append(kwargs.get('config_file'))
    config_files = [os.path.expanduser(f) for f in config_files]
    config = utils.configparser.RawConfigParser({
        'username': '',
        'api_key': '',
        'endpoint_url': '',
        'timeout': '0',
        'proxy': '',
    })
    config.read(config_files)

    if config.has_section('softlayer'):
        return {
            'endpoint_url': config.get('softlayer', 'endpoint_url'),
            'timeout': config.getfloat('softlayer', 'timeout'),
            'proxy': config.get('softlayer', 'proxy'),
            'username': config.get('softlayer', 'username'),
            'api_key': config.get('softlayer', 'api_key'),
        }
766024
def get_default_config(self):
        
        config = super(cloudwatchHandler, self).get_default_config()

        config.update({
            'region': 'us-east-1',
            'collector': 'loadavg',
            'metric': '01',
            'namespace': 'MachineLoad',
            'name': 'Avg01',
            'unit': 'None',
            'collect_by_instance': True,
            'collect_without_dimension': False
        })

        return config
439858
def pb_config(self):
        """"""
        pb = ProcessingBlock(self._pb_id)
        return json.dumps(pb.config)
1278757
def default(self, block, name):
        
        return self._kvs.default(self._key(block, name))
659745
def get_default_config(self):
        
        config = super(BindCollector, self).get_default_config()
        config.update({
            'host': 'localhost',
            'port': 8080,
            'path': 'bind',
            # Available stats:
            # - resolver (Per-view resolver and cache statistics)
            # - server (Incoming requests and their answers)
            # - zonemgmt (Requests/responses related to zone management)
            # - sockets (Socket statistics)
            # - memory (Global memory usage)
            'publish': [
                'resolver',
                'server',
                'zonemgmt',
                'sockets',
                'memory',
            ],
            # By default we don't publish these special views
            'publish_view_bind': False,
            'publish_view_meta': False,
        })
        return config
1140967
def get_default_config(self):
        
        default_config = super(SNMPInterfaceCollector,
                               self).get_default_config()
        default_config['path'] = 'interface'
        default_config['byte_unit'] = ['bit', 'byte']
        return default_config
1330222
def _opts_defaults(self, **kwargs):
        '''
        
        '''
        # Let's start with the default salt cloud configuration
        opts = salt.config.DEFAULT_CLOUD_OPTS.copy()
        # Update it with the loaded configuration
        opts.update(self.opts.copy())
        # Reset some of the settings to sane values
        opts['parallel'] = False
        opts['keep_tmp'] = False
        opts['deploy'] = True
        opts['update_bootstrap'] = False
        opts['show_deploy_args'] = False
        opts['script_args'] = ''
        # Update it with the passed kwargs
        if 'kwargs' in kwargs:
            opts.update(kwargs['kwargs'])
        opts.update(kwargs)
        profile = opts.get('profile', None)
        # filter other profiles if one is specified
        if profile:
            tmp_profiles = opts.get('profiles', {}).copy()
            for _profile in [a for a in tmp_profiles]:
                if not _profile == profile:
                    tmp_profiles.pop(_profile)
            # if profile is specified and we have enough info about providers
            # also filter them to speedup methods like
            # __filter_non_working_providers
            providers = [a.get('provider', '').split(':')[0]
                         for a in six.itervalues(tmp_profiles)
                         if a.get('provider', '')]
            if providers:
                _providers = opts.get('providers', {})
                for provider in _providers.copy():
                    if provider not in providers:
                        _providers.pop(provider)
        return opts
533801
async function _default(config, routesConfig) {
  const res = await (0, _startApp.default)(config);
  const {
    url,
    app,
    router,
    middleware,
    connect
  } = res;
  let methods;

  if (routesConfig) {
    methods = await (0, _routes.initRoutes2)(routesConfig, middleware, router);
    const routes = router.routes();
    app.use(routes);
  }

  return {
    url,
    app,
    connect,
    methods,
    router
  };
}
398630
function makeDefaultOptions() {
  return {
    baseUrl: "/djedi",
    batchInterval: 10, // ms
    defaultRender: state => {
      switch (state.type) {
        case "loading":
          return "Loading…";
        case "error":
          return `Failed to fetch content 😞 (${
            state.error.response != null ? state.error.response.status : -1
          })`;
        case "success":
          return state.content;
        // istanbul ignore next
        default:
          return null;
      }
    },
    fetch: defaultFetch,
    languages: {
      default: "en-us",
      additional: [],
    },
    uri: {
      defaults: {
        scheme: "i18n",
        namespace: "",
        path: "",
        ext: "txt",
        version: "",
      },
      namespaceByScheme: {
        i18n: "{language}",
        l10n: "local",
        g11n: "global",
      },
      separators: {
        scheme: "://",
        namespace: "@",
        path: "/",
        ext: ".",
        version: "#",
      },
    },
  };
}
388573
def get_default_config(self):
        
        config = super(rmqHandler, self).get_default_config()

        config.update({
            'server': '127.0.0.1',
            'rmq_exchange': 'diamond',
        })

        return config
1101576
function _getAll (config) {
  return Promise.all(
    handleBlocks(config)
  ).then(function (results) {
    let result = {}
    results.forEach(function (block) {
      result[block.blockName] = block.result
    })
    return result
  })
    .catch(err => {
      var blockName = err.options ? err.options.uri : 'NO URI FOUND'
      log.error(`WARNING! 
      NO BLOCKS WILL BE LOADED DUE TO ERROR IN ONE OF THE BLOCKS. 
      FIX ALL BROKEN BLOCKS IMMEDIATELY. 
      ATTEMPTED TO LOAD BLOCK: ${blockName}`)
      throw err
    })
}
1232430
def get_default_config(self):
        
        config = super(HttpPostHandler, self).get_default_config()

        config.update({
            'url': 'http://localhost/blah/blah/blah',
            'batch': 100,
        })

        return config
575221
def get_default_config(self):
        
        default_config = super(SNMPRawCollector,
                               self).get_default_config()
        default_config.update({
            'oids': {},
            'path_prefix': 'servers',
            'path_suffix': 'snmp',
        })
        return default_config