Loads the question type specific options for the question.
161331
public function get_question_options($question) {
        global $DB, $OUTPUT;
        // Get additional information from database
        // and attach it to the question object.
        if (!$question->options = $DB->get_record('question_truefalse',
                array('question' => $question->id))) {
            echo $OUTPUT->notification('Error: Missing question options!');
            return false;
        }
        // Load the answers.
        if (!$question->options->answers = $DB->get_records('question_answers',
                array('question' =>  $question->id), 'id ASC')) {
            echo $OUTPUT->notification('Error: Missing question answers for truefalse question ' .
                    $question->id . '!');
            return false;
        }

        return true;
    }
226718
def parse_options():
    

    parser = optparse.OptionParser(usage=USAGE, version=VERSION)

    parser.add_option("-q", "--query",
            action="store", type="string", default="", dest="query",
            help="SPARQL query string")

    parser.add_option("-f", "--format",
            action="store", type="string", default="JSON", dest="format",
            help="Results format: one of JSON, XML")

    parser.add_option("-d", "--describe",
            action="store", type="string", default="", dest="describe",
            help="Describe Query: just pass a URI")

    parser.add_option("-a", "--alltriples",
            action="store", type="string", default="", dest="alltriples",
            help="Get all available triples for a URI")

    parser.add_option("-o", "--ontology",
            action="store_true", default=False, dest="ontology",
            help="Get all entities of type owl:Class - aka the ontology")

    opts, args = parser.parse_args()

    if len(args) > 0:  #dont take no args
        parser.print_help()
        raise SystemExit, 1
    if not (opts.query or opts.describe or opts.alltriples or opts.ontology):
        parser.print_help()
        raise SystemExit, 1
    return opts, args
28645
protected function loadFinalType()
	{
		foreach($this->databaseMapping as $entityMapping)
		{
			foreach($entityMapping['columns'] as $pos => $column)
			{
				if(!isset($this->finalTypes[$pos]))
				{
					if(isset($column['type']))
					{
						$this->finalTypes[$pos] = $column['type'];
					}
					else
					{
						$this->finalTypes[$pos] = null;
					}
				}
				elseif(isset($column['type']) && $this->finalTypes[$pos] != $column['type'])
				{
					$this->finalTypes[$pos] = Type::STRING;
				}
			}
		}
	}
905352
def add_question(self, qname, rdtype, rdclass=dns.rdataclass.IN):
        

        self._set_section(QUESTION)
        before = self.output.tell()
        qname.to_wire(self.output, self.compress, self.origin)
        self.output.write(struct.pack("!HH", rdtype, rdclass))
        after = self.output.tell()
        if after >= self.max_size:
            self._rollback(before)
            raise dns.exception.TooBig
        self.counts[QUESTION] += 1
1226176
def process_question(self):
        
        image_files = []
        question_data = json.loads(self.raw_data)

        # process urls for widgets
        self._recursive_url_find(question_data, image_files)

        # Process question
        if 'question' in question_data and 'images' in question_data['question']:
            question_data['question']['images'], qfiles = self.process_image_field(question_data['question'])
            image_files += qfiles

        # Process hints
        if 'hints' in question_data:
            for hint in question_data['hints']:
                if 'images' in hint:
                    hint['images'], hfiles = self.process_image_field(hint)
                    image_files += hfiles

        # Process answers
        if 'answers' in question_data:
            for answer in question_data['answers']:
                if 'images' in answer:
                    answer['images'], afiles = self.process_image_field(answer)
                    image_files += afiles

        # Process raw data
        self.raw_data = json.dumps(question_data, ensure_ascii=False)
        # Assume no need for special HTML processing for Persues questions
        # This avoids probelms with questions that contain < and > inequalities
        # in formulas that get erroneously parsed as HTML tags
        self.raw_data, data_files = super(PerseusQuestion, self).set_images(self.raw_data, parse_html=False)

        # Combine all files processed
        self.files = image_files + data_files

        # Return all filenames
        return [f.filename for f in self.files]
920219
public function load_choices() {
        global $CFG; // Remove this line and behold the horror of behat test failures!
        $this->choices = array();
        foreach (core_component::get_plugin_list('gradereport') as $plugin => $plugindir) {
            if (file_exists($plugindir . '/lib.php')) {
                require_once($plugindir . '/lib.php');
                // Check to see if the class exists. Check the correct plugin convention first.
                if (class_exists('gradereport_' . $plugin)) {
                    $classname = 'gradereport_' . $plugin;
                } else if (class_exists('grade_report_' . $plugin)) {
                    // We are using the old plugin naming convention.
                    $classname = 'grade_report_' . $plugin;
                } else {
                    continue;
                }
                if ($classname::supports_mygrades()) {
                    $this->choices[$plugin] = get_string('pluginname', 'gradereport_' . $plugin);
                }
            }
        }
        // Add an option to specify an external url.
        $this->choices['external'] = get_string('externalurl', 'grades');
        return true;
    }
121886
private QuestionnaireItemType answerTypeForBinding(ElementDefinitionBindingComponent binding) {
    if (binding == null) 
      return QuestionnaireItemType.OPENCHOICE;
    else if (binding.getStrength() != BindingStrength.REQUIRED) 
      return QuestionnaireItemType.OPENCHOICE;
    else
      return QuestionnaireItemType.CHOICE;
  }
1153424
def choice(self, question, choices, default=None, attempts=None, multiple=False):
        
        question = ChoiceQuestion(question, choices, default)

        question.set_max_attempts(attempts)
        question.set_multi_select(multiple)

        return self._io.ask_question(question)
815364
public void loadSettingValues() {
    PreferencesFxUtils.categoriesToSettings(flatCategoriesLst)
        .forEach(setting -> {
          LOGGER.trace("Loading: " + setting.getBreadcrumb());
          if (saveSettings) {
            setting.loadSettingValue(storageHandler);
          }
          history.attachChangeListener(setting);
        });
  }
624226
@Override
    public void processIOSettingQuestion(IOSetting setting) {
        // post the question
        if (setting.getLevel().ordinal() <= this.level.ordinal()) {
            String answer = setting.getSetting();

            if (setting instanceof BooleanIOSetting) {
                int n = JOptionPane.showConfirmDialog(frame, setting.getQuestion(), setting.getName(),
                        JOptionPane.YES_NO_OPTION);
                if (n == JOptionPane.YES_OPTION) {
                    answer = "true";
                } else if (n == JOptionPane.NO_OPTION) {
                    answer = "false";
                } else {
                    // default of setting
                }
            } else if (setting instanceof OptionIOSetting) {
                OptionIOSetting optionSetting = (OptionIOSetting) setting;
                List<String> settings = optionSetting.getOptions();
                Iterator<String> elements = settings.iterator();
                Object[] options = new Object[settings.size()];
                for (int i = 0; i < options.length; i++) {
                    options[i] = elements.next();
                }
                int n = JOptionPane.showOptionDialog(frame, setting.getQuestion(), setting.getName(),
                        JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, setting.getSetting());
                answer = (String) options[n];
            } else if (setting instanceof StringIOSetting) {
                answer = JOptionPane.showInputDialog(frame, setting.getQuestion(), setting.getName(),
                        JOptionPane.QUESTION_MESSAGE, null, null, setting.getSetting()).toString();
            } else {
                answer = JOptionPane.showInputDialog(frame, setting.getQuestion(), setting.getName(),
                        JOptionPane.QUESTION_MESSAGE, null, null, setting.getSetting()).toString();
            }

            try {
                setting.setSetting(answer);
            } catch (CDKException exception) {
            }
        } // else skip question

    }
779867
private void loadOptionsFromFile(String filepath){
        try {
            BufferedReader in = new BufferedReader(new FileReader(filepath));

            String stream0 = in.readLine();
            outlierAlgoPanel0.setStreamValueAsCLIString(stream0);

            String algo0 = in.readLine();
            outlierAlgoPanel0.setAlgorithm0ValueAsCLIString(algo0);

            System.out.println("Loading settings from "+filepath);
            logPanel.addText("Loading settings from "+filepath);

        } catch (Exception e) {
            System.out.println("Bad option file:"+e.getMessage());
        }
    }
1267267
def prompt(questions: List[Dict[Text, Any]],
           answers: Optional[Dict[Text, Any]] = None,
           patch_stdout: bool = False,
           true_color: bool = False,
           kbi_msg: Text = DEFAULT_KBI_MESSAGE,
           **kwargs):
    """"""

    if isinstance(questions, dict):
        questions = [questions]

    answers = answers or {}

    for question_config in questions:
        # import the question
        if 'type' not in question_config:
            raise PromptParameterException('type')
        if 'name' not in question_config:
            raise PromptParameterException('name')

        choices = question_config.get('choices')
        if choices is not None and callable(choices):
            question_config['choices'] = choices(answers)

        _kwargs = kwargs.copy()
        _kwargs.update(question_config)

        _type = _kwargs.pop('type')
        _filter = _kwargs.pop('filter', None)
        name = _kwargs.pop('name')
        when = _kwargs.pop('when', None)

        if true_color:
            _kwargs["color_depth"] = ColorDepth.TRUE_COLOR

        try:
            if when:
                # at least a little sanity check!
                if callable(question_config['when']):
                    try:
                        if not question_config['when'](answers):
                            continue
                    except Exception as e:
                        raise ValueError("Problem in 'when' check of {} "
                                         "question: {}".format(name, e))
                else:
                    raise ValueError("'when' needs to be function that "
                                     "accepts a dict argument")
            if _filter:
                # at least a little sanity check!
                if not callable(_filter):
                    raise ValueError("'filter' needs to be function that "
                                     "accepts an argument")

            if callable(question_config.get('default')):
                _kwargs['default'] = question_config['default'](answers)

            create_question_func = prompt_by_name(_type)

            if not create_question_func:
                raise ValueError("No question type '{}' found. "
                                 "Known question types are {}."
                                 "".format(_type, ", ".join(AVAILABLE_PROMPTS)))

            missing_args = list(utils.missing_arguments(create_question_func,
                                                        _kwargs))
            if missing_args:
                raise PromptParameterException(missing_args[0])

            question = create_question_func(**_kwargs)

            answer = question.unsafe_ask(patch_stdout)

            if answer is not None:
                if _filter:
                    try:
                        answer = _filter(answer)
                    except Exception as e:
                        raise ValueError("Problem processing 'filter' of {} "
                                         "question: {}".format(name, e))
                answers[name] = answer
        except KeyboardInterrupt:
            print('')
            print(kbi_msg)
            print('')
            return {}
    return answers
1014922
def load(self):
        
        # load the custom format
        if self._customFormat and os.path.exists(self.fileName()):
            self._customFormat.load(self.fileName())
1233286
function (question, defaultValue) {
  var choiceValues = _.map(question.choices, function (choice) {
    if (typeof choice === 'object') {
      return choice.value;
    } else {
      return choice;
    }
  });

  return choiceValues.indexOf(defaultValue);
}
936081
def _load_types(root):
    """"""
    def text(t):
        if t.tag == 'name':
            return '{name}'
        elif t.tag == 'apientry':
            return '{apientry}'
        out = []
        if t.text:
            out.append(_escape_tpl_str(t.text))
        for x in t:
            out.append(text(x))
            if x.tail:
                out.append(_escape_tpl_str(x.tail))
        return ''.join(out)
    out_dict = collections.OrderedDict()
    for elem in root.findall('types/type'):
        name = elem.get('name') or elem.find('name').text
        template = text(elem)
        api = elem.get('api')
        if 'requires' in elem.attrib:
            required_types = set((elem.attrib['requires'],))
        else:
            required_types = set()
        comment = elem.get('comment')
        if api:
            k = (name, api)
        else:
            k = (name, None)
        out_dict[k] = Type(name, template, required_types, api, comment)
    return out_dict
191634
protected function loadOptions(): void
    {
        $options = [];

        if ($this->preset == 'custom') {
            $optionsFile = null;
        } else {
            $optionsFile = __DIR__ . '/presets/' . $this->preset . '.php';
        }

        if ($optionsFile !== null) {
            if (!is_file($optionsFile)) {
                throw new InvalidConfigException('The CKEditor options file can not be loaded.');
            }
            $options = require($optionsFile);
        }

        $this->clientOptions = ArrayHelper::merge(
            $options,
            $this->clientOptions
        );
    }
1737
public function load_choices() {
        if (during_initial_install()) {
            return false;
        }
        if (is_array($this->choices)) {
            return true;
        }

        $this->choices = ['' => new lang_string('sitepolicyhandlercore', 'core_admin')];
        $manager = new \core_privacy\local\sitepolicy\manager();
        $plugins = $manager->get_all_handlers();
        foreach ($plugins as $pname => $unused) {
            $this->choices[$pname] = new lang_string('sitepolicyhandlerplugin', 'core_admin',
                ['name' => new lang_string('pluginname', $pname), 'component' => $pname]);
        }

        return true;
    }