Set bitcoind options globally.
    Call this before trying to talk to bitcoind.
170518
def get_bitcoind_config(config_file=None, impl=None):
    

    loaded = False

    bitcoind_server = None
    bitcoind_port = None
    bitcoind_user = None
    bitcoind_passwd = None
    bitcoind_timeout = None
    bitcoind_regtest = None
    bitcoind_p2p_port = None
    bitcoind_spv_path = None

    regtest = None

    if config_file is not None:

        parser = SafeConfigParser()
        parser.read(config_file)

        if parser.has_section('bitcoind'):

            if parser.has_option('bitcoind', 'server'):
                bitcoind_server = parser.get('bitcoind', 'server')

            if parser.has_option('bitcoind', 'port'):
                bitcoind_port = int(parser.get('bitcoind', 'port'))

            if parser.has_option('bitcoind', 'p2p_port'):
                bitcoind_p2p_port = int(parser.get('bitcoind', 'p2p_port'))

            if parser.has_option('bitcoind', 'user'):
                bitcoind_user = parser.get('bitcoind', 'user')

            if parser.has_option('bitcoind', 'passwd'):
                bitcoind_passwd = parser.get('bitcoind', 'passwd')

            if parser.has_option('bitcoind', 'spv_path'):
                bitcoind_spv_path = parser.get('bitcoind', 'spv_path')

            if parser.has_option('bitcoind', 'regtest'):
                regtest = parser.get('bitcoind', 'regtest')
            else:
                regtest = 'no'

            if parser.has_option('bitcoind', 'timeout'):
                bitcoind_timeout = float(parser.get('bitcoind', 'timeout'))

            if regtest.lower() in ["yes", "y", "true", "1", "on"]:
                bitcoind_regtest = True
            else:
                bitcoind_regtest = False
            
            loaded = True

    if not loaded:

        bitcoind_server = 'bitcoin.blockstack.com'
        bitcoind_port = 8332
        bitcoind_user = 'blockstack'
        bitcoind_passwd = 'blockstacksystem'
        bitcoind_regtest = False
        bitcoind_timeout = 300
        bitcoind_p2p_port = 8333
        bitcoind_spv_path = os.path.expanduser("~/.virtualchain-spv-headers.dat")

    default_bitcoin_opts = {
        "bitcoind_user": bitcoind_user,
        "bitcoind_passwd": bitcoind_passwd,
        "bitcoind_server": bitcoind_server,
        "bitcoind_port": bitcoind_port,
        "bitcoind_timeout": bitcoind_timeout,
        "bitcoind_regtest": bitcoind_regtest,
        "bitcoind_p2p_port": bitcoind_p2p_port,
        "bitcoind_spv_path": bitcoind_spv_path
    }

    return default_bitcoin_opts
1209423
def setCurrentIndex(self, index):
        
        if 0 <= index and index < len(self._stack):
            self._blockStack = True
            self._index = index
            self.emitCurrentChanged()
            self._blockStack = False
            return True
        return False
101990
def _set_option(self, name, value, allow_clear=False):
        """"""
        if not allow_clear:
            # Prevent clears if value was set
            try:
                current_value = self._get_option(name)
                if value is None and current_value is not None:
                    return
            except AttributeError:
                pass

        self.opts[name] = value
1054100
def global_start_index(self, value):
        """"""
        if not isinstance(value, int) and value is not None:
            raise TypeError('global_start_index attribute must be of int '
                            'type.')
        self._global_start_index = value
1031352
protected function setGlobalOptions() {
    if (isset($this->uri) && !empty($this->uri)) {
      $this->option('uri', $this->uri);
    }

    if (!$this->interactive) {
      $this->option('no-interaction');
    }

    if ($this->verbose !== FALSE) {
      $verbosity_threshold = $this->verbosityThreshold();
      switch ($verbosity_threshold) {
        case OutputInterface::VERBOSITY_VERBOSE:
          $this->verbose(TRUE);
          break;

        case OutputInterface::VERBOSITY_VERY_VERBOSE:
          $this->veryVerbose(TRUE);
          break;

        case OutputInterface::VERBOSITY_DEBUG:
          $this->debug(TRUE);
          break;
      }
    }
    if ($this->verbosityThreshold() >= OutputInterface::VERBOSITY_VERBOSE
      && $this->verbose !== FALSE) {
      $this->verbose(TRUE);
    }

    if (($this->debug || $this->getConfig()->get('drush.debug'))
      && $this->getConfig()->get('drush.debug') !== FALSE) {
      $this->option('-vvv');
    }
    elseif (($this->veryVerbose || $this->getConfig()->get('drush.veryVerbose'))
      && $this->getConfig()->get('drush.veryVerbose') !== FALSE) {
      $this->option('-vv');
    }
    elseif (($this->verbose || $this->getConfig()->get('drush.verbose'))
      && $this->getConfig()->get('drush.verbose') !== FALSE) {
      $this->option('-v');
    }

    if ($this->include) {
      $this->option('include', $this->include);
    }

    if ($this->ansi) {
      $this->option("ansi");
    }
  }
532906
def set(option, value=(not_set=true), ignore_setter=false, &block)
      raise ArgumentError, 'value not set' if block and !not_set
      return self if !not_set and value.nil?

      if not_set
        set_options option
        return self
      end

      if respond_to?("#{option}=") and not ignore_setter
        return __send__("#{option}=", value)
      end

      define_accessors option, value
      self
    end
509647
def remove_global_option(self, option):
        
        if not isinstance(option, DhcpOpt):
            raise TypeError("option can only be an instance of type DhcpOpt")
        self._call("removeGlobalOption",
                     in_p=[option])
871207
def set_default_option(cls, key, value):
        """"""
        cls._default_options.update(cls._option_schema({key: value}))
1247458
def set_options(self, multiplex_first=True, **bogus_options):
        ""
        self.multiplex_first = multiplex_first
        self._warn_bogus_options(**bogus_options)
43851
def options(name, *args, &block)
      NsOptions::RootMethods.new(self, name).define($stdout, caller)
      self.send(name, *args, &block)
    end
1095336
def set_gnu_getopt(self, gnu_getopt=True):
    
    self.__dict__['__use_gnu_getopt'] = gnu_getopt
    self.__dict__['__use_gnu_getopt_explicitly_set'] = True
264112
def set_option(self, name, value):
        """"""
        _assert_value_is_valid(name)
        self._options[name] = value
1001489
def set(self, section, option, value):
        """"""
        with self._lock:
            self._set(section, option, value)
921853
def set_option(option, *args)
      if Call.respond_to?(:libusb_set_option)
        # Available since libusb-1.0.22

        ffi_args = case option
          when :OPTION_LOG_LEVEL, LIBUSB::OPTION_LOG_LEVEL
            expect_option_args(1, args.length)
            [:libusb_log_level, args[0]]
          when :OPTION_USE_USBDK, LIBUSB::OPTION_USE_USBDK
            expect_option_args(0, args.length)
            []
          else
            raise ArgumentError, "unknown option #{option.inspect}"
        end

        res = Call.libusb_set_option(@ctx, option, *ffi_args)
        LIBUSB.raise_error res, "in libusb_set_option" if res<0

      else
        # Fallback to deprecated function, if the gem is linked to an older libusb.

        raise ArgumentError, "unknown option #{option.inspect}" unless [:OPTION_LOG_LEVEL, LIBUSB::OPTION_LOG_LEVEL].include?(option)
        Call.libusb_set_debug(@ctx, *args)
      end
    end
1187144
def connect_bitcoind_impl( bitcoind_opts ):
    

    if 'bitcoind_port' not in bitcoind_opts.keys() or bitcoind_opts['bitcoind_port'] is None:
        log.error("No port given")
        raise ValueError("No RPC port given (bitcoind_port)")

    if 'bitcoind_timeout' not in bitcoind_opts.keys() or bitcoind_opts['bitcoind_timeout'] is None:
        # default
        bitcoind_opts['bitcoind_timeout'] = 300

    try:
        int(bitcoind_opts['bitcoind_port'])
    except:
        log.error("Not an int: '%s'" % bitcoind_opts.get('bitcoind_port'))
        raise

    try:
        float(bitcoind_opts.get('bitcoind_timeout', 300))
    except:
        log.error("Not a float: '%s'" % bitcoind_opts.get('bitcoind_timeout', 300))
        raise

    return create_bitcoind_connection( bitcoind_opts['bitcoind_user'], bitcoind_opts['bitcoind_passwd'], \
                                       bitcoind_opts['bitcoind_server'], int(bitcoind_opts['bitcoind_port']), \
                                       bitcoind_opts.get('bitcoind_use_https', False), float(bitcoind_opts.get('bitcoind_timeout', 300)) )
194752
def app_options
      if ambiguous?
        hash = {}
        @global_options.each_with_index do |option, i|
          hash[i] = option['name'] || option['root']
        end
        hash
      else
        {}
      end
    end
843331
async def set_kernel_options(cls, options: typing.Optional[str]):
        """"""
        await cls.set_config("kernel_opts", "" if options is None else options)