Useful for example to spread changes to the prompt, e.g. enabling or
        disabling colors.
431668
def iter_walk_menus(self):
        
        yield self
        for item in self.name_to_command.values():
            if isinstance(item, _Menu):
                # "Generator delegation" ;)
                # https://docs.python.org/3/whatsnew/3.3.html#pep-380
                yield from item.iter_walk_menus()
47728
function intro() {
  // @TODO: How best to pull in .scss color data export to reference branch colors below?
  const b = chalk.hex('#545DA6'); // indigo, light
  const y = chalk.hex('#ffcc4d'); // yellow, base

  const CLI_TITLE = chalk.bold.underline('Bolt-CLI');
  const CLI_DESCRIPTION = 'Welcome to the Bolt CLI ⚡️  Have fun!';
  const CLI_USAGE = 'Usage: `bolt <command> [options ...]`';
  const HELP_USAGE = 'Help: `bolt -h` or `bolt <command> --help`';

  // const HELP_HEADER_BACKUP = `
  //     /˜˜˜˜˜˜˜˜˜˜˜˜\
  //    / /˜˜˜˜/|˜˜˜˜\ \
  //   / /    / |     \ \
  //  / /    /  |____  \ \
  // / /    /       /   \ \
  // \ \   /____   /    / /
  //  \ \      |  /    / /
  //   \ \     | /    / /
  //    \ \____|/____/ /
  //     \____________/
  // `

  // ^ Colorized + partially filled in version of logo above
  const HELP_HEADER = `
    ${b('///////|\\\\\\\\\\\\')}
   ${b('///˜˜˜˜')}${y('/|')}${b('˜˜˜˜\\\\\\')}
  ${b('///    ')}${y('//|')}${b('     \\\\\\')}     ${CLI_TITLE}
 ${b('///    ')}${y('///|____')}${b('  \\\\\\')}
${b('///    ')}${y('/////////')}${b('   \\\\\\')}   ${CLI_DESCRIPTION}
${b('\\\\\\   ')}${y('/////////')}${b('    ///')}
 ${b('\\\\\\      ')}${y('|///')}${b('    ///')}    ${CLI_USAGE}
  ${b('\\\\\\     ')}${y('|//')}${b('    ///')}     ${HELP_USAGE}
   ${b('\\\\\\____')}${y('|/')}${b('____///')}
    ${b('\\\\\\\\\\\\|///////')}
`;

  info(HELP_HEADER);
}
125019
protected static function showHelp()
    {
        \cli\line();
        \cli\out(self::$arguments->getHelpScreen(\cli\Colors::colorize('%N%n%gAvailable commands:')));
        \cli\line();
    }
1109929
function Prompt () {
  Base.apply(this, arguments);

  if (!this.opt.basePath) {
    this.throwParamError('basePath');
  }

  this.pathIndexHash = {};
  this.originalBaseDir = this.currentPath =
    path.normalize(path.isAbsolute(this.opt.basePath) ?
      path.resolve(this.opt.basePath) : path.resolve(process.cwd(), this.opt.basePath));

  if (String(this.currentPath).endsWith(path.sep)) {
    this.currentPath = String(this.currentPath).slice(0, -1);
  }

  this.onlyOneFile = !!this.opt.onlyOneFile;

  this.opt.choices = new Choices(this.createChoices(this.currentPath), this.answers);
  this.selected = 0;

  if (this.opt.filterItems) {
    assert(typeof this.opt.filterItems === 'function', ' "filterItems" option property must be a function.');
  }

  this.firstRender = true;

  // Make sure no default is set (so it won't be printed)
  this.opt.default = null;
  this.searchTerm = '';
  this.paginator = new Paginator();
}
394312
protected function displayHelpInformation()
	{
		$this->env->sendOutput('PhoxPHP Command Line Interface help.', 'green');
		$this->env->sendOutput('Usage:'. $this->env->addTab() . 'php console [command id] [...arguments]');
		$this->env->sendOutput($this->env->addTab() . 'E.g: ' . 'php console help list-commands' . $this->env->addNewLine());
		$this->env->sendOutput($this->env->addTab() . 'list-runnables: ' . $this->env->addTab() . 'Lists all available runnables id');
		$this->env->sendOutput($this->env->addTab() . 'create-runnable: ' . $this->env->addTab() . 'Creates a new runnable class');
		$this->env->sendOutput($this->env->addTab() . 'list-runnable-commands: ' . 'Lists all commands available in a runnable object');
	}
748039
def set_colorization_enabled(enabled):
    
    # If color is supposed to be enabled and this is windows, we have to enable console virtual terminal sequences:
    if enabled and platform.system() == 'Windows':
        Colors.COLORIZATION_ENABLED = enable_windows_virtual_terminal_sequences()
    else:
        # This is not windows so we can enable color immediately.
        Colors.COLORIZATION_ENABLED = enabled
1124870
function makeChangeSingleDocInEditor(cm, change, spans) {
  let doc = cm.doc, display = cm.display, from = change.from, to = change.to

  let recomputeMaxLength = false, checkWidthStart = from.line
  if (!cm.options.lineWrapping) {
    checkWidthStart = lineNo(visualLine(getLine(doc, from.line)))
    doc.iter(checkWidthStart, to.line + 1, line => {
      if (line == display.maxLine) {
        recomputeMaxLength = true
        return true
      }
    })
  }

  if (doc.sel.contains(change.from, change.to) > -1)
    signalCursorActivity(cm)

  updateDoc(doc, change, spans, estimateHeight(cm))

  if (!cm.options.lineWrapping) {
    doc.iter(checkWidthStart, from.line + change.text.length, line => {
      let len = lineLength(line)
      if (len > display.maxLineLength) {
        display.maxLine = line
        display.maxLineLength = len
        display.maxLineChanged = true
        recomputeMaxLength = false
      }
    })
    if (recomputeMaxLength) cm.curOp.updateMaxLine = true
  }

  retreatFrontier(doc, from.line)
  startWorker(cm, 400)

  let lendiff = change.text.length - (to.line - from.line) - 1
  // Remember that these lines changed, for updating the display
  if (change.full)
    regChange(cm)
  else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))
    regLineChange(cm, from.line, "text")
  else
    regChange(cm, from.line, to.line + 1, lendiff)

  let changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change")
  if (changeHandler || changesHandler) {
    let obj = {
      from: from, to: to,
      text: change.text,
      removed: change.removed,
      origin: change.origin
    }
    if (changeHandler) signalLater(cm, "change", cm, obj)
    if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj)
  }
  cm.display.selForContextMenu = null
}
1086399
def on_ok(self):
        
        npyscreen.notify_wait('Deleting instances given...',
                              title='In progress')
        # keep track of number for shifting instances down for alignment
        shift_num = 1
        to_update = []
        for i, val in enumerate(self.del_instances.values):
            # clean all tools for renmaing and relabeling purposes
            t = val.split(':')
            section = self.display_to_section[val]
            prev_running = self.manifest.option(section, 'running')
            run = prev_running[0] and prev_running[1] == 'yes'
            if i in self.del_instances.value:
                if run:
                    # grab dependencies of tools that linked to previous one
                    if i == 0:
                        dependent_tools = [self.manifest.option(
                            section, 'link_name')[1]]
                        for dependency in Dependencies(dependent_tools):
                            self.clean(**dependency)
                            to_update.append(dependency)
                    self.clean(name=t[0], branch=t[1], version=t[2])
                self.manifest.del_section(section)
            else:
                try:
                    # update instances for tools remaining
                    section = self.display_to_section[val]
                    settings_dict = json.loads(self.manifest.option
                                               (section, 'settings')[1])
                    settings_dict['instances'] = self.new_instances
                    self.manifest.set_option(section, 'settings',
                                             json.dumps(settings_dict))
                    # check if tool name doesn't need to be shifted because
                    # it's already correct
                    identifier = str(shift_num) if shift_num != 1 else ''
                    new_section = section.rsplit(':', 2)
                    new_section[0] = re.sub(r'\d+$', identifier,
                                            new_section[0])
                    new_section = ':'.join(new_section)
                    if section != new_section:
                        # clean tool so that we can rename its container and
                        # labels with new information
                        self.clean(name=t[0], branch=t[1], version=t[2])
                        prev_name = self.manifest.option(section, 'name')[1]
                        new_name = re.split(r'[0-9]', prev_name)[0] + \
                            identifier
                        self.manifest.set_option(section, 'name', new_name)
                        # copy new contents into shifted version
                        self.manifest.add_section(new_section)
                        for val_pair in self.manifest.section(section)[1]:
                            self.manifest.set_option(new_section, val_pair[0],
                                                     val_pair[1])
                        self.manifest.del_section(section)
                        if run:
                            to_update.append({'name': new_name,
                                              'branch': t[1],
                                              'version': t[2]})
                    shift_num += 1
                except Exception as e:
                    npyscreen.notify_confirm('Trouble deleting tools'
                                             ' because ' + str(e))
        self.manifest.write_config()
        tool_d = {}
        for tool in to_update:
            tool_d.update(self.prep_start(**tool)[1])
        if tool_d:
            self.start_tools(tool_d)
        npyscreen.notify_confirm('Done deleting instances.',
                                 title='Finished')
        self.change_screens()
957487
function writePrompt () {
        charm.position(1,1);
        charm.display('bright');
        charm.write(promptStart);
        charm.write(' ');
        charm.display('reset');
    }
1077401
function broadcastChanges(changes) {
    if (!changes.length) {
      return;
    }
    const intercom = Intercom.getInstance();
    changes.forEach(function (change) {
      intercom.emit(change.event, change.path);
    });
  }
654089
function Prompt(...args) {
  Base.apply(this, args);
  this.opt = args[0],
  this.previousAnswers = args[2];
  this.selected = 0;
  this.paginator = new Paginator();
  this.firstRender = true;
  if (typeof this.opt.placeholder === 'function') {
    this.getPlaceholder = this.opt.placeholder;
  } else if (typeof this.opt.placeholder === 'string') {
    this.getPlaceholder = () => this.opt.placeholder;
  } else {
    this.getPlaceholder = () => 'INSERT HERE';
  }

  const events = observe(args[1]);
  const keyDowns = events.keypress.filter(function(e) {
    return e.key.name === 'down';
  }).share();
  const keyUps = events.keypress.filter(function(e) {
    return e.key.name === 'up';
  }).share();
  keyDowns.takeUntil(events.line).forEach(this.onDownKey.bind(this));
  keyUps.takeUntil(events.line).forEach(this.onUpKey.bind(this));
  events.line.forEach(this.onSubmit.bind(this));
  return this;
}
524015
def provide(prompt, options = {})
      options.reverse_merge! required: true, default: nil
      required = options[:required] && !options[:default]
      prompt = "#{defaulted_prompt(prompt, options[:default])}: "

      if Stairs.configuration.use_defaults && options[:default]
        options[:default]
      else
        Stairs::Util::CLI.collect(prompt.blue, required: required) ||
          options[:default]
      end
    end
296056
function (enable) {
            var cfg = this._cfg;
            // check for disposal
            if (!cfg) {
                return;
            }
            var helpText = cfg.helptext, helpTextConfig = this._skinObj.helpText;
            // stops if no helptext, or trying to disable an helptext that as
            // not been set
            if (!helpText || !this._helpTextSet && !enable || (this._hasFocus || this._keepFocus) && enable) {
                return;
            }

            var field = this.getTextInputField();

            // stops if trying to set a helptext in a field with a value
            if (field.value && enable) {
                return;
            }

            this._helpTextSet = enable;

            if (!field) {
                return;
            }

            // determine new styles and value
            var color = enable ? helpTextConfig.color : this._getTextFieldColor();
            var value = enable ? helpText : "";

            var helpTextClass = "x" + this._skinnableClass + "_" + cfg.sclass + "_helpText";
            var classNames = field.className.split(/\s+/);
            ariaUtilsArray.remove(classNames, helpTextClass);
            if (enable) {
                classNames.push(helpTextClass);
            }
            field.className = classNames.join(' ');

            // update styles
            var style = field.style;
            style.color = color;

            // update field value
            field.value = value;
        }
274315
def toggle_settings(
        toolbar=False, nbname=False, hideprompt=False, kernellogo=False):
    """"""

    toggle = ''
    if toolbar:
        toggle += 'div#maintoolbar {margin-left: 8px !important;}\n'
        toggle += '.toolbar.container {width: 100% !important;}\n'
    else:
        toggle += 'div#maintoolbar {display: none !important;}\n'
    if nbname:
        toggle += ('span.save_widget span.filename {margin-left: 8px; height: initial;'
                   'font-size: 100%; color: @nb-name-fg; background-color:'
                   '@cc-input-bg;}\n')
        toggle += ('span.save_widget span.filename:hover {color:'
                   '@nb-name-hover; background-color: @cc-input-bg;}\n')
        toggle += ('#menubar {padding-top: 4px; background-color:'
                   '@notebook-bg;}\n')
    else:
        toggle += '#header-container {display: none !important;}\n'
    if hideprompt:
        toggle += 'div.prompt.input_prompt {display: none !important;}\n'
        toggle += 'div.prompt.output_prompt {width: 5ex !important;}\n'
        toggle += 'div.out_prompt_overlay.prompt:hover {width: 5ex !important; min-width: 5ex !important;}\n'
        toggle += (
            '.CodeMirror-gutters, .cm-s-ipython .CodeMirror-gutters'
            '{ position: absolute; left: 0; top: 0; z-index: 3; width: 2em; '
            'display: inline-block !important; }\n')
        toggle += ('div.cell.code_cell .input { border-left: 5px solid @cm-gutters !important; border-bottom-left-radius: 5px; border-top-left-radius: 5px; }\n')
    if kernellogo:
        toggle += '@kernel-logo-display: block;'
    else:
        toggle += '@kernel-logo-display: none;'

    return toggle
1187497
def update_colors(self, colors):
        """"""
        
        colors = np.array(colors, dtype=np.uint8)
        self._vbo_c.set_data(colors)
        self._vbo_c.unbind()
230429
function prompt (next) {
    var fields = ['name', 'author', 'description', 'homepage'];
    app.prompt.override = {name: name};
    app.prompt.start();
    app.prompt.addProperties(info, fields, next);
  }
726056
def apply_color(self, arr, state):
        """"""
        ops = self.cmd(state)
        for func in parse_operations(ops):
            arr = func(arr)
        return arr