Content about info files

@param {Object} answers
@return {Object}
173930
function getInfoFiles(answers) {
    const locales = ['en', 'es', 'pt_BR'];
    return locales
        | map(locale => ({ filename: path.join(answers.name, `info/${locale}.md`), content: '' }));
}
547348
def get_answer(message, answers='Yn', default='Y', quit=''):
    
    if quit and quit not in answers:
        answers = answers + quit
        
    message = message + '(' + '/'.join(answers) + ')[' + default + ']:'
    ans = raw_input(message).strip().upper()
    if default and not ans:
        ans = default.upper()
    while ans not in answers.upper():
        ans = raw_input(message).strip().upper()
    if quit and ans == quit.upper():
        print "Command be cancelled!"
        sys.exit(0)
    return ans
120418
function getContent() {
      var h = pageInformation.response.headers || {};
      if (/json/.test(h['content-type'])) {
        try {
          return JSON.parse(page.plainText);
        }
        catch (e) {
          return page.content;
        }
      }
      else {
        return page.content;
      }
    }
142635
def generate_answers
      the_answers = {}
      masterless  = @options[:masterless]
      database    = masterless ? nil : only_host_with_role(@hosts, 'database')
      dashboard   = masterless ? nil : only_host_with_role(@hosts, 'dashboard')
      master      = masterless ? nil : only_host_with_role(@hosts, 'master')
      @hosts.each do |h|
        if @options[:type] == :upgrade and h[:pe_ver] =~ /\A3.0/
          # 3.0.x to 3.0.x should require no answers
          the_answers[h.name] = {
            :q_install => answer_for(@options, :q_install, 'y'),
            :q_install_vendor_packages => answer_for(@options, :q_install_vendor_packages, 'y'),
          }
        else
          the_answers[h.name] = host_answers(h, master, database, dashboard, @options)
        end
        if the_answers[h.name] && h[:custom_answers]
          the_answers[h.name] = the_answers[h.name].merge(h[:custom_answers])
        end
        h[:answers] = the_answers[h.name]
      end
      return the_answers
    end
1347262
function getFormFiles(metaDataFilePath) {
  var formsZipMetaData = require(metaDataFilePath);
  if (formsZipMetaData && formsZipMetaData.files) {
    var formFiles = formsZipMetaData.files;
    return _.map(formFiles, function(formDetails) {
      return formDetails.path;
    });
  } else {
    return [];
  }
}
927379
function Questions(options) {
  if (!(this instanceof Questions)) {
    return new Questions(options);
  }
  debug('initializing from <%s>', __filename);
  Options.call(this, utils.omitEmpty(options || {}));
  use(this);
  this.initQuestions(this.options);
}
311114
function(src, dest){
      self.logger.warn('File at '+dest+' exists, overwrite?');
      
      rl.question('(yN) ', function(answer){
        switch(answer.toLowerCase()){
          case 'y':
            this.copy(src, dest); 
            this.triggerNext(); 
            break; 
          case 'n':
            this.triggerNext(); 
            break; 
          default:
            this.waitForResponse(src, dest); 
            break; 
        }
      }.bind(this)); 
    }
799410
def get_explanation(logical_form: str,
                    world_extractions: JsonDict,
                    answer_index: int,
                    world: QuarelWorld) -> List[JsonDict]:
    
    output = []
    nl_world = {}
    if world_extractions['world1'] != "N/A" and world_extractions['world1'] != ["N/A"]:
        nl_world['world1'] = nl_world_string(world_extractions['world1'])
        nl_world['world2'] = nl_world_string(world_extractions['world2'])
        output.append({
                "header": "Identified two worlds",
                "content": [f'''world1 = {nl_world['world1']}''',
                            f'''world2 = {nl_world['world2']}''']
        })
    else:
        nl_world['world1'] = 'world1'
        nl_world['world2'] = 'world2'
    parse = semparse_util.lisp_to_nested_expression(logical_form)
    if parse[0] != "infer":
        return None
    setup = parse[1]
    output.append({
            "header": "The question is stating",
            "content": nl_arg(setup, nl_world)
    })
    answers = parse[2:]
    output.append({
            "header": "The answer options are stating",
            "content": ["A: " + " and ".join(nl_arg(answers[0], nl_world)),
                        "B: " + " and ".join(nl_arg(answers[1], nl_world))]
    })
    setup_core = setup
    if setup[0] == 'and':
        setup_core = setup[1]
    s_attr = setup_core[0]
    s_dir = world.qr_size[setup_core[1]]
    s_world = nl_world[setup_core[2]]
    a_attr = answers[answer_index][0]
    qr_dir = world._get_qr_coeff(strip_entity_type(s_attr), strip_entity_type(a_attr))  # pylint: disable=protected-access
    a_dir = s_dir * qr_dir
    a_world = nl_world[answers[answer_index][2]]

    content = [f'When {nl_attr(s_attr)} is {nl_dir(s_dir)} ' +
               f'then {nl_attr(a_attr)} is {nl_dir(a_dir)} (for {s_world})']
    if a_world != s_world:
        content.append(f'''Therefore {nl_attr(a_attr)} is {nl_dir(-a_dir)} for {a_world}''')
    content.append(f"Therefore {chr(65+answer_index)} is the correct answer")

    output.append({
            "header": "Theory used",
            "content": content
    })

    return output
937248
function (changes) {
    return new FileInfo({
      src: changes && changes.src !== undefined ? changes.src : this.src,
      resolved: changes && changes.resolved !== undefined ? changes.resolved : this.resolved,
      base: changes && changes.base !== undefined ? changes.base : this.base,
      dest: changes && changes.dest !== undefined ? changes.dest : this.dest,
      destBase: changes && changes.destBase !== undefined ? changes.destBase : this.destBase,
      watch: changes && changes.watch !== undefined ? changes.watch : this.watch
    })
  }
368469
function getIndexFile(answers) {
    const content = format(`
        import { create } from 'rung-sdk';
        import { String as Text } from 'rung-cli/dist/types';

        function render(name) {
            return <b>{ _('Hello {{name}}', { name }) }</b>;
        }

        function main(context) {
            const { name } = context.params;
            return {
                alerts: [{
                    title: _('Welcome'),
                    content: render(name),
                    resources: []
                }]
            };
        }

        const params = {
            name: {
                description: _('What is your name?'),
                type: Text
            }
        };

        export default create(main, {
            params,
            primaryKey: true,
            title: _(${JSON.stringify(answers.title)}),
            description: _(${JSON.stringify(answers.description)}),
            preview: render('Trixie')
        });
    `);

    return { filename: path.join(answers.name, 'index.js'), content };
}
1305297
function posts (content, contentType) {
  let output = {}
  const allFiles = content.filter(each => each.dir.includes(`/${contentType}`))
  const index = allFiles.filter(each => each.base === 'index.md')[0]
  index.attr.forEach(each => {
    allFiles.forEach(file => {
      if (file.name === each) {
        output[each] = file
      }
    })
  })
  return output
}
857258
def process_question(self):
        
        # Process question
        self.question, question_files = self.set_images(self.question)

        # Process answers
        answers = []
        answer_files = []
        answer_index = 0
        for answer in self.answers:
            processed_string, afiles = self.set_images(answer['answer'])
            answers.append({"answer": processed_string, "correct": answer['correct'], "order": answer_index})
            answer_index += 1
            answer_files += afiles
        self.answers = answers

        # Process hints
        hints = []
        hint_files = []
        hint_index = 0
        for hint in self.hints:
            processed_string, hfiles = self.set_images(hint)
            hints.append({"hint": processed_string, "order": hint_index})
            hint_index += 1
            hint_files += hfiles
        self.hints = hints

        self.files += question_files + answer_files + hint_files
        return [f.filename for f in self.files]
335944
function ask(file, opts, cb) {
  if (typeof opts === 'function') {
    cb = opts;
    opts = {};
  }
  opts = opts || {};
  var prompt = lazy.inquirer.createPromptModule();
  var fp = path.relative(process.cwd(), file.path);

  var questions = {
    name: 'action',
    type: 'expand',
    message: 'Overwrite `' + fp + '`?',
    value: 'nothing',
    choices: [{
      key: 'n',
      name: 'do not overwrite',
      value: 'skip'
    }, {
      key: 'y',
      name: 'overwrite',
      value: 'write'
    }, {
      key: 'a',
      name: 'overwrite this and all others',
      value: 'force'
    }, {
      key: 'x',
      name: 'abort',
      value: 'abort'
    }, {
      key: 'd',
      name: 'diff comparison between the current and new:',
      value: 'diff'
    }]
  };

  prompt([questions], function (answers) {
    var msg = answers.action;

    switch(answers.action) {
      case 'skip':
        cb(answers.action);
        process.exit(0);

      case 'abort':
        msg = utils.red(utils.error) + ' Aborted. No action was taken.';
        if (!opts.silent) console.log(msg);
        cb(answers.action);
        process.exit(0);

      case 'diff':
        var existing = opts.existing || fs.readFileSync(fp, 'utf8');
        if (lazy.isBinary(existing) && typeof opts.binaryDiff === 'function') {
          opts.binaryDiff(existing, file.contents);
        } else {
          stringDiff(existing, file.contents.toString());
        }
        return ask(file, opts, cb);

      case 'force':
        opts.force = true;
        break;

      case 'write':
        msg = utils.green(utils.success) + ' file written to';
        opts.force = true;
        break;

      default: {
        msg = utils.red(utils.error) + utils.red(' Aborted.') + ' No action was taken.';
        if (!opts.silent) console.log(msg);
        cb(answers.action);
        process.exit(0);
      }
    }

    var rel = path.relative(process.cwd(), fp);
    var filepath = utils[answers.action](rel);
    if (!opts.silent) {
      console.log(msg, filepath);
    }
    return cb(answers.action);
  });
}
1214801
function promptAsync(prompts) {
  return new Promise(function(resolve, reject) {
    parent.prompt.call(parent, prompts, function(answers) {
      resolve(answers)
    });
  });
}
779077
function buildInquirerChoices(cards) {
  return cards.sources.map(source => {
    const _default =
      source.id === cards.defaultSource ? ` ${chalk.bold('(default)')}` : '';
    const id = `${chalk.cyan(`ID: ${source.id}`)}${_default}`;
    const number = `${chalk.gray('#### ').repeat(3)}${source.last4 ||
      source.card.last4}`;
    const str = [
      id,
      indent(source.name || source.owner.name, 2),
      indent(`${source.brand || source.card.brand} ${number}`, 2)
    ].join('\n');

    return {
      name: str, // Will be displayed by Inquirer
      value: source.id, // Will be used to identify the answer
      short: source.id // Will be displayed after the users answers
    };
  });
}
1330064
function(/* Array */ files) {

                    var preprocessor;

                    if (_.isEmpty(files)) {
                        return preprocessor;
                    }

                    // collect all the possible extensions
                    // and remove duplicates
                    files = _.chain(files).map(function (/* string */ file) {

                        var ext = path.extname(file).split('.');

                        return ext[ext.length - 1];

                    }).uniq().value();

                    preprocessor = _.find(Object.keys(plugin.preprocessors), function (/* String */ key) {

                        var value = plugin.preprocessors[key],
                            exts = value.split(/[,\s]+/),

                            matches = _.filter(files, function (/* String */ ext) {
                                return exts.indexOf(ext) !== -1;
                            });

                        return !_.isEmpty(matches);

                    });

                    return preprocessor;

                }
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;
}