Build a string to display in the 'select deployment' menu.
327812
def _deployment_menu_entry(deployment):
    """"""
    paths = ", ".join([_module_name_for_display(module) for module in deployment['modules']])
    regions = ", ".join(deployment.get('regions', []))
    return "%s - %s (%s)" % (deployment.get('name'), paths, regions)
566871
private String buildTargetString(List<String> privateLibraries) {
        StringBuilder filter = new StringBuilder();
        filter.append("(&");
        for (String lib : privateLibraries)
            filter.append(String.format("(|(%s=%s)(%s=%s))", LibraryStatusService.LIBRARY_IDS, lib, LibraryStatusService.LIBRARY_PIDS, lib));
        filter.append(")");
        return filter.toString();
    }

    @Override
    public String getName() {
        return "ApplicationClassloaderConfigurationHelper";
    }
694161
private static String buildJmolSelection(ResidueNumber[] residues) {
		StringBuilder cmd = new StringBuilder("select ");
		for(ResidueNumber res : residues) {
			if(res != null) {
				cmd.append(String.format("%d^%s:%s.CA or ", res.getSeqNum(),
						res.getInsCode()==null?" ":res.getInsCode(),
								res.getChainName()));
			}
		}
		cmd.append("none;");//easier than removing the railing 'or'
		return cmd.toString();
	}
712311
def _build_option_string(self, options):
        
        option_string = ""
        if options is not None:
            for key in options:
                option_string += "/%s-%s" % (key, options[key])
        return self._quote_url(option_string)
294474
private function _optionsHTML()
    {
        $result = '';
        foreach ($this->options() as $key => $label) {
            $selected = ResourceTable::getSearchValue($this->index()) == $key ? ' selected="selected"' : '';
            $result .= '<option value="'.$key.'"'.$selected.'>'.$label.'</option>';
        }
        return $result;
    }
219618
private function buildUiVars()
    {
        $context = $this->getContext();
        $params = $this->getParametersHelper();

        $vars = [
            'select'    => false,
            'config'    => false,
            'batch'     => false,
            'export'    => false,
            'profile'   => false,
            'page_name' => $params->getPageName(),
        ];

        // Select
        $select = null !== $mode = $this->getSelectionMode();

        if ($select) {
            $vars['select'] = [
                'multiple' => $mode === Util\Config::SELECTION_MULTIPLE,
                'name'     => $params->getIdentifiersName(),
                'all'      => $params->getAllName(),
            ];
        }

        // Batch
        if ($this->config->isBatchable() && !empty($this->actions)) {
            $actionChoices = [];
            foreach ($this->actions as $action) {
                $label = $action->getConfig()->getOption('label');
                //$translationDomain = $action->getConfig()->getOption('translation_domain');

                $actionChoices[] = [
                    'value' => $action->getName(),
                    'label' => $label ?: ucfirst($action->getName()),
                    //'translation_domain' => $translationDomain,
                ];
            }

            $vars['batch'] = [
                'choices' => $actionChoices,
                'name'    => $params->getActionName(),
                'button'  => $params->getBatchButton(),
            ];
        }

        // Export
        if ($this->config->isExportable() && $this->config->hasExportAdapters()) {
            $exportChoices = [];
            foreach (['csv', 'json', 'xml'] as $format) { // TODO formats from config or adapters
                $exportChoices[] = [
                    'value' => $format,
                    'label' => strtoupper($format),
                ];
            }

            $vars['export'] = [
                'choices' => $exportChoices,
                'name'    => $params->getFormatName(),
                'button'  => $params->getExportButton(),
            ];
        }

        // Config
        if ($this->config->isConfigurable()) {
            // Visible columns choices
            $visibleColumns = $context->getVisibleColumns();
            $columnChoices = [];
            foreach ($this->columns as $column) {
                $columnChoices[] = [
                    'value'  => $column->getName(),
                    'label'  => $column->getLabel(),
                    'active' => in_array($column->getName(), $visibleColumns, true),
                ];
            }

            // Max per page choices
            $maxPerPage = $context->getMaxPerPage();
            $maxPerPageChoices = [];
            foreach ($this->config->getPerPageChoices() as $choice) {
                $maxPerPageChoices[] = [
                    'value'  => $choice,
                    'label'  => $choice,
                    'active' => $choice == $maxPerPage,
                ];
            }

            $vars['config'] = [
                'column'       => [
                    'choices' => $columnChoices,
                    'name'    => $params->getColumnsName(),
                ],
                'max_per_page' => [
                    'choices' => $maxPerPageChoices,
                    'name'    => $params->getMaxPerPageName(),
                ],
                'button'       => $params->getConfigButton(),
            ];
        }

        // Profiles
        if ($this->config->isProfileable()) {
            $profileChoices = [];
            if (null !== $storage = $this->getConfig()->getProfileStorage()) {
                foreach ($storage->all($this) as $profile) {
                    $profileChoices[] = [
                        'value' => $profile->getKey(),
                        'label' => $profile->getName(),
                    ];
                }
            }
            $vars['profile'] = [
                'select' => [
                    'name'          => $params->getProfileChoiceName(),
                    'choices'       => $profileChoices,
                    'load_button'   => $params->getProfileLoadButton(),
                    'edit_button'   => $params->getProfileEditButton(),
                    'remove_button' => $params->getProfileRemoveButton(),
                ],
                'create' => [
                    'name'   => $params->getProfileNameName(),
                    'button' => $params->getProfileCreateButton(),
                ],
            ];
        }

        return $vars;
    }
583853
function selectAppArgs(options) {
  return {
    name: options.name,
    targetUrl: options.targetUrl,
    counter: options.counter,
    bounce: options.bounce,
    width: options.width,
    height: options.height,
    minWidth: options.minWidth,
    minHeight: options.minHeight,
    maxWidth: options.maxWidth,
    maxHeight: options.maxHeight,
    x: options.x,
    y: options.y,
    showMenuBar: options.showMenuBar,
    fastQuit: options.fastQuit,
    userAgent: options.userAgent,
    nativefierVersion: options.nativefierVersion,
    ignoreCertificate: options.ignoreCertificate,
    disableGpu: options.disableGpu,
    ignoreGpuBlacklist: options.ignoreGpuBlacklist,
    enableEs3Apis: options.enableEs3Apis,
    insecure: options.insecure,
    flashPluginDir: options.flashPluginDir,
    diskCacheSize: options.diskCacheSize,
    fullScreen: options.fullScreen,
    hideWindowFrame: options.hideWindowFrame,
    maximize: options.maximize,
    disableContextMenu: options.disableContextMenu,
    disableDevTools: options.disableDevTools,
    zoom: options.zoom,
    internalUrls: options.internalUrls,
    crashReporter: options.crashReporter,
    singleInstance: options.singleInstance,
    clearCache: options.clearCache,
    appCopyright: options.appCopyright,
    appVersion: options.appVersion,
    buildVersion: options.buildVersion,
    win32metadata: options.win32metadata,
    versionString: options.versionString,
    processEnvs: options.processEnvs,
    fileDownloadOptions: options.fileDownloadOptions,
    tray: options.tray,
    basicAuthUsername: options.basicAuthUsername,
    basicAuthPassword: options.basicAuthPassword,
    alwaysOnTop: options.alwaysOnTop,
    titleBarStyle: options.titleBarStyle,
    globalShortcuts: options.globalShortcuts,
  };
}
1374567
function(options, select) {
                if (options.length === 0) {
                    return this.nonSelectedText;
                }
                else if (this.allSelectedText
                         && options.length === $('option', $(select)).length
                         && $('option', $(select)).length !== 1
                         && this.multiple) {

                    if (this.selectAllNumber) {
                        return this.allSelectedText + ' (' + options.length + ')';
                    }
                    else {
                        return this.allSelectedText;
                    }
                }
                else if (options.length > this.numberDisplayed) {
                    return options.length + ' ' + this.nSelectedText;
                }
                else {
                    var selected = '';
                    var delimiter = this.delimiterText;

                    options.each(function() {
                        var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).text();
                        selected += label + delimiter;
                    });

                    return selected.substr(0, selected.length - 2);
                }
            }
1060304
def string_build(self, data, modname="", path=None):
        """"""
        module = self._data_build(data, modname, path)
        module.file_bytes = data.encode("utf-8")
        return self._post_build(module, "utf-8")
1250978
private function getOptionText() : string
    {
        if (count($this->command->getOptions()) === 0) {
            return '  No options';
        }

        $optionTexts = [];

        foreach ($this->command->getOptions() as $option) {
            $optionTexts[] = [$this->getOptionNames($option), $option->getDescription()];
        }

        return $this->paddingFormatter->format($optionTexts, function ($row) {
            return "  <info>{$row[0]}</info> - {$row[1]}";
        });
    }
750312
private function buildSelect()
	{
		$selects = [];

		foreach ($this->select as $select)
		{
			$string = ($select['count']) ? "COUNT({$select['column']})" : $select['column'];

			// See if we're including an alias
			if (isset($select['as']))
			{
				$string .= " AS {$select['as']}";
			}

			// @FIXME: not quoting name here because we could have a function here as well
			// $selects[] = $this->connection->quoteName($string, $select['as']);
			$selects[] = $string;
		}

		return 'SELECT ' . implode(',', $selects);
	}
432722
def quote_selection(self):
        """"""

        selection = self.get_selection()
        current_table = self.grid.current_table
        for row, col, tab in self.grid.code_array.dict_grid.keys():
            if tab == current_table and (row, col) in selection:
                self.grid.actions.quote_code((row, col, tab))

        self.grid.code_array.result_cache.clear()
1349108
def __str(self, quote=False, prefix="", suffix=""):
        
        quotes = '"%s"'
        pstr = "dry_run=%s, " % self._dry_run

        kmods = self._kmods
        kmods = [quotes % k for k in kmods] if quote else kmods
        pstr += "kmods=[%s], " % (",".join(kmods))

        services = self._services
        services = [quotes % s for s in services] if quote else services
        pstr += "services=[%s]" % (",".join(services))

        return prefix + pstr + suffix
1326827
def as_select(self, _items=None, **kwargs):
        
        attrs = self.extra.copy()
        attrs.update(kwargs)
        attrs['name'] = self.name
        if not self.optional:
            attrs['required'] = True
        html = [u'<select %s>' % get_html_attrs(attrs)]
        values = [self.to_string(**attrs)] or []
        items = _items or self.items

        for item in items:
            if isinstance(item, list):
                html.extend(self._render_optgroup(item, values))
            else:
                html.append(self._render_option(item, values))
        html.append(u'</select>')

        return Markup('\n'.join(html))
1256358
private function createLeftMenu(): string
    {
        $argsCount = 0;
        $arrayKey = $this->getArrayKey($this->menuData);
        $output = '<ul class="navbar navbar-nav mr-auto">';
        foreach ($arrayKey as $menuItem) {
            list($url, $text, $place, $id, $class) = $this->getLinkInformation([$menuItem]);
            if ($place == 'left') {
                $arguments[$argsCount] = $menuItem;
                $arraySubKey = $this->getArrayKey($this->menuData[$menuItem]);
                if (count($arraySubKey) === 0) {
                    $output .= '<li class="nav-item">';
                    $output .= $this->createNavLinkUrl($arguments);
                    $output .= '</li>';
                } else {
                    $output .= '<li class="nav-item dropdown">';
                    $output .= $this->createSubmenu($arguments, $this->menuData[$menuItem]);
                    $output .= '</li>';
                }
            }
        }
        $output .= '</ul>';
        return $output;
    }
934019
protected function render_select(): string
    {
        if (!$this->choices) {
            return '';
        }

        $html = '<select '.$this->metaString().' id="'.
            $this->escape->attr($this->id).'" name="'.
            $this->escape->attr($this->name).'">';

        foreach ($this->choices as $value => $label) {
            if (isset($this->meta['multiple'])) {
                $selected = $this->selected(
                    $value,
                    (\in_array($value, (array)$this->value) ? $value : '')
                );
            } else {
                $selected = $this->selected($value, $this->value);
            }

            $html .= '<option '.$selected.' value="'.
                $this->escape->attr($value).'">'.$label.'</option>';
        }

        $html .= '</select>';

        return $html;
    }
63111
def show(ctx):
    

    for app_name, app in ctx.obj['config']['apps'].items():
        click.echo(click.style(app_name, fg='green', bold=True))
        for migration in app['migrations']:
            applied = ctx.obj['db'].is_migration_applied(app_name, migration)
            click.echo('  {0} {1}'.format(migration, click.style('(applied)', bold=True) if applied else ''))