Sets the answers declared with 'doAnswer' style.
481840
public void setAnswersForStubbing(List<Answer<?>> answers, Strictness strictness) {
        doAnswerStyleStubbing.setAnswers(answers, strictness);
    }
346079
function (question, answer) {
  var choiceValues = _.map(question.choices, 'value');
  var choiceIndex = choiceValues.indexOf(answer);

  // Check if answer is not equal to default value
  if (question.default !== choiceIndex) {
    return true;
  }

  return false;
}
603673
function processAnswers(answers) {
    let config = {
        rules: {},
        env: {},
        parserOptions: {},
        extends: []
    };

    // set the latest ECMAScript version
    config.parserOptions.ecmaVersion = DEFAULT_ECMA_VERSION;
    config.env.es6 = true;
    config.globals = {
        Atomics: "readonly",
        SharedArrayBuffer: "readonly"
    };

    // set the module type
    if (answers.moduleType === "esm") {
        config.parserOptions.sourceType = "module";
    } else if (answers.moduleType === "commonjs") {
        config.env.commonjs = true;
    }

    // add in browser and node environments if necessary
    answers.env.forEach(env => {
        config.env[env] = true;
    });

    // add in library information
    if (answers.framework === "react") {
        config.parserOptions.ecmaFeatures = {
            jsx: true
        };
        config.plugins = ["react"];
    } else if (answers.framework === "vue") {
        config.plugins = ["vue"];
        config.extends.push("plugin:vue/essential");
    }

    // setup rules based on problems/style enforcement preferences
    if (answers.purpose === "problems") {
        config.extends.unshift("eslint:recommended");
    } else if (answers.purpose === "style") {
        if (answers.source === "prompt") {
            config.extends.unshift("eslint:recommended");
            config.rules.indent = ["error", answers.indent];
            config.rules.quotes = ["error", answers.quotes];
            config.rules["linebreak-style"] = ["error", answers.linebreak];
            config.rules.semi = ["error", answers.semi ? "always" : "never"];
        } else if (answers.source === "auto") {
            config = configureRules(answers, config);
            config = autoconfig.extendFromRecommended(config);
        }
    }

    // normalize extends
    if (config.extends.length === 0) {
        delete config.extends;
    } else if (config.extends.length === 1) {
        config.extends = config.extends[0];
    }

    ConfigOps.normalizeToStrings(config);
    return config;
}
189500
private void setQuestionnaireAnswers(CoverSheet coverSheet,
			ProjectNarrative projectNarrative) {
		List<? extends AnswerContract> answers = getPropDevQuestionAnswerService().getQuestionnaireAnswers(pdDoc.getDevelopmentProposal().getProposalNumber(),getNamespace(),getFormName());
		for (AnswerContract answer : answers) {
			Integer seqId = getQuestionAnswerService().findQuestionById(answer.getQuestionId()).getQuestionSeqId();
            switch (seqId) {
			case PRELIMINARY:
				YesNoNotApplicableDataType.Enum yesNoNotApplicableDataType = YesNoNotApplicableDataType.N_NO;
				if (QUESTIONNAIRE_ANSWER_YES.equals(answer.getAnswer())) {
					yesNoNotApplicableDataType = YesNoNotApplicableDataType.Y_YES;
				} else if (QUESTIONNAIRE_ANSWER_NO.equals(answer.getAnswer())) {
					yesNoNotApplicableDataType = YesNoNotApplicableDataType.N_NO;
				} else if (QUESTIONNAIRE_ANSWER_X.equals(answer.getAnswer())) {
					yesNoNotApplicableDataType = YesNoNotApplicableDataType.NA_NOT_APPLICABLE;
				}
				coverSheet.setCheckFullApp(yesNoNotApplicableDataType);
				break;
			case MERIT_REVIEW:
				if (QUESTIONNAIRE_ANSWER_YES.equals(answer.getAnswer())) {
					projectNarrative
							.setCheckMeritReview(YesNoNotApplicableDataType.Y_YES);
				} else if (QUESTIONNAIRE_ANSWER_NO.equals(answer.getAnswer())) {
					projectNarrative
							.setCheckMeritReview(YesNoNotApplicableDataType.N_NO);
				} else if (QUESTIONNAIRE_ANSWER_X.equals(answer.getAnswer())) {
					projectNarrative
							.setCheckMeritReview(YesNoNotApplicableDataType.NA_NOT_APPLICABLE);
				}
				break;

			case MENTORING:
				if (QUESTIONNAIRE_ANSWER_YES.equals(answer.getAnswer())) {
					projectNarrative
							.setCheckMentoring(YesNoNotApplicableDataType.Y_YES);
				} else if (QUESTIONNAIRE_ANSWER_NO.equals(answer.getAnswer())) {
					projectNarrative
							.setCheckMentoring(YesNoNotApplicableDataType.N_NO);
				}
				break;

			case PRIOR_SUPPORT:
				// Does narrative include info regarding prior support?
				if (QUESTIONNAIRE_ANSWER_YES.equals(answer.getAnswer()))
					projectNarrative
							.setCheckPriorSupport(YesNoNotApplicableDataType.Y_YES);
				if (QUESTIONNAIRE_ANSWER_NO.equals(answer.getAnswer()))
					projectNarrative
							.setCheckPriorSupport(YesNoNotApplicableDataType.N_NO);
				if (QUESTIONNAIRE_ANSWER_X.equals(answer.getAnswer()))
					projectNarrative
							.setCheckPriorSupport(YesNoNotApplicableDataType.NA_NOT_APPLICABLE);
				break;
			case HR_QUESTION:
				/*
				 * HR Info that is mandatory for renwals from academic
				 * institutions.
				 */
				if (QUESTIONNAIRE_ANSWER_NO.equals(answer.getAnswer())) {
					projectNarrative
							.setCheckHRInfo(YesNoNotApplicableDataType.N_NO);
				}
				break;
			case HR_REQUIRED_INFO:
				/*
				 * HR Info that is mandatory for renwals from academic
				 * institutions.
				 */
				if (QUESTIONNAIRE_ANSWER_YES.equals(answer.getAnswer())) {
					projectNarrative
							.setCheckHRInfo(YesNoNotApplicableDataType.Y_YES);
				}
				break;
			default:
				break;
			}
		}
	}
1131454
def set_widgets(self):
        """"""
        self.clear_further_steps()
        # Set widgets
        purpose = self.parent.step_kw_purpose.selected_purpose()
        self.lstSubcategories.clear()
        self.lblDescribeSubcategory.setText('')
        self.lblIconSubcategory.setPixmap(QPixmap())
        self.lblSelectSubcategory.setText(
            get_question_text('%s_question' % purpose['key']))
        for i in self.subcategories_for_layer():
            # noinspection PyTypeChecker
            item = QListWidgetItem(i['name'], self.lstSubcategories)
            # noinspection PyTypeChecker
            item.setData(QtCore.Qt.UserRole, i['key'])
            self.lstSubcategories.addItem(item)

        # Check if layer keywords are already assigned
        key = self.parent.step_kw_purpose.selected_purpose()['key']
        keyword = self.parent.get_existing_keyword(key)

        # Overwrite the keyword if it's KW mode embedded in IFCW mode
        if self.parent.parent_step:
            keyword = self.parent.get_parent_mode_constraints()[1]['key']

        # Set values based on existing keywords or parent mode
        if keyword:
            subcategories = []
            for index in range(self.lstSubcategories.count()):
                item = self.lstSubcategories.item(index)
                subcategories.append(item.data(QtCore.Qt.UserRole))
            if keyword in subcategories:
                self.lstSubcategories.setCurrentRow(
                    subcategories.index(keyword))

        self.auto_select_one_item(self.lstSubcategories)
15930
public function addAnswer(\Lyon1\Bundle\PoobleBundle\Entity\SurveyAnswer $answer)
    {
        $this->answers[] = $answer;

        return $this;
    }
176531
public void setAnswerPattern(String v) {
    if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_answerPattern == null)
      jcasType.jcas.throwFeatMissing("answerPattern", "edu.cmu.lti.oaqa.framework.types.InputElement");
    jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_answerPattern, v);}
500653
def declare_response(self, code='200', **kwargs):
        """"""  # noqa: E501
        self['responses'][str(code)] = self._new_operation(**kwargs)
762372
protected static <K, T> void groupAnswer(final Map<K, List<T>> answer, T element, K value) {
        if (answer.containsKey(value)) {
            answer.get(value).add(element);
        } else {
            List<T> groupedElements = new ArrayList<T>();
            groupedElements.add(element);
            answer.put(value, groupedElements);
        }
    }
1176761
def set_options(self, **kw):
        
        """
        for k, v in kw.iteritems():
            if k in self.__options:
                self.__options[k] = v
642147
public static <A> Answer<Void> toAnswer(final VoidAnswer1<A> answer) {
        return new Answer<Void>() {
            @SuppressWarnings("unchecked")
            public Void answer(InvocationOnMock invocation) throws Throwable {
                answer.answer((A)invocation.getArgument(0));
                return null;
            }
        };
    }
203944
def _set_declarations(self, declarations):
        """"""
        assert isinstance(declarations, CodeStatement)
        self.declarations = declarations
        declarations.scope = self.body
304603
public void writeAnswers(List<IN> doc, PrintWriter printWriter,
                           DocumentReaderAndWriter<IN> readerAndWriter)
    throws IOException {
    if (flags.lowerNewgeneThreshold) {
      return;
    }
    if (flags.numRuns <= 1) {
      readerAndWriter.printAnswers(doc, printWriter);
      // out.println();
      printWriter.flush();
    }
  }
1113729
public function setRawAnswers($answers)
    {
        $survey = $this->getSurvey();
        $source = $survey->getSource();

        $source->setRawTokenAnswers($this, $answers, $survey->getSurveyId(), $survey->getSourceSurveyId());

        // They are not always loaded
        if ($this->hasAnswersLoaded()) {
            //Now update internal answer cache
            $this->_sourceDataRaw = $answers + $this->_sourceDataRaw;
        }
    }
1013471
function Choices( choices, answers ) {
  this.choices = _.map( choices, function( val ) {
    if ( val.type === "separator" ) {
      return val;
    }
    return new Choice( val, answers );
  });

  this.realChoices = this.choices
    .filter(Separator.exclude)
    .filter(function( item ) {
      return !item.disabled;
    });

  Object.defineProperty( this, "length", {
    get: function() {
      return this.choices.length;
    },
    set: function( val ) {
      this.choices.length = val;
    }
  });

  Object.defineProperty( this, "realLength", {
    get: function() {
      return this.realChoices.length;
    },
    set: function() {
      throw new Error("Cannot set `realLength` of a Choices collection");
    }
  });

  // Set pagination state
  this.pointer = 0;
  this.lastIndex = 0;
}
644025
public function removeAnswer(Answer $answer)
    {
        if ($this->answers->contains($answer)) {
            $this->answers->removeElement($answer);
        }
    }
411260
def MarkDone(self, responses):
    """"""
    client_id = responses.request.client_id
    self.AddResultsToCollection(responses, client_id)
    self.MarkClientDone(client_id)