Create a list of `Option` instances for the options sidebar.
168684
def _create_options(self):
        
        def enable(attribute, value=True):
            setattr(self, attribute, value)

            # Return `True`, to be able to chain this in the lambdas below.
            return True

        def disable(attribute):
            setattr(self, attribute, False)
            return True

        def simple_option(title, description, field_name, values=None):
            " Create Simple on/of option. "
            values = values or ['off', 'on']

            def get_current_value():
                return values[bool(getattr(self, field_name))]

            def get_values():
                return {
                    values[1]: lambda: enable(field_name),
                    values[0]: lambda: disable(field_name),
                }

            return Option(title=title, description=description,
                          get_values=get_values,
                          get_current_value=get_current_value)

        brightness_values = [1.0 / 20 * value for value in range(0, 21)]

        return [
            OptionCategory('Input', [
                simple_option(title='Editing mode',
                              description='Vi or emacs key bindings.',
                              field_name='vi_mode',
                              values=[EditingMode.EMACS, EditingMode.VI]),
                simple_option(title='Paste mode',
                              description="When enabled, don't indent automatically.",
                              field_name='paste_mode'),
                Option(title='Complete while typing',
                       description="Generate autocompletions automatically while typing. "
                                   'Don\'t require pressing TAB. (Not compatible with "History search".)',
                       get_current_value=lambda: ['off', 'on'][self.complete_while_typing],
                       get_values=lambda: {
                           'on': lambda: enable('complete_while_typing') and disable('enable_history_search'),
                           'off': lambda: disable('complete_while_typing'),
                       }),
                Option(title='History search',
                       description='When pressing the up-arrow, filter the history on input starting '
                                   'with the current text. (Not compatible with "Complete while typing".)',
                       get_current_value=lambda: ['off', 'on'][self.enable_history_search],
                       get_values=lambda: {
                           'on': lambda: enable('enable_history_search') and disable('complete_while_typing'),
                           'off': lambda: disable('enable_history_search'),
                       }),
                simple_option(title='Mouse support',
                              description='Respond to mouse clicks and scrolling for positioning the cursor, '
                                          'selecting text and scrolling through windows.',
                              field_name='enable_mouse_support'),
                simple_option(title='Confirm on exit',
                              description='Require confirmation when exiting.',
                              field_name='confirm_exit'),
                simple_option(title='Input validation',
                              description='In case of syntax errors, move the cursor to the error '
                                          'instead of showing a traceback of a SyntaxError.',
                              field_name='enable_input_validation'),
                simple_option(title='Auto suggestion',
                              description='Auto suggest inputs by looking at the history. '
                                          'Pressing right arrow or Ctrl-E will complete the entry.',
                              field_name='enable_auto_suggest'),
                Option(title='Accept input on enter',
                       description='Amount of ENTER presses required to execute input when the cursor '
                                   'is at the end of the input. (Note that META+ENTER will always execute.)',
                       get_current_value=lambda: str(self.accept_input_on_enter or 'meta-enter'),
                       get_values=lambda: {
                           '2': lambda: enable('accept_input_on_enter', 2),
                           '3': lambda: enable('accept_input_on_enter', 3),
                           '4': lambda: enable('accept_input_on_enter', 4),
                           'meta-enter': lambda: enable('accept_input_on_enter', None),
                       }),
            ]),
            OptionCategory('Display', [
                Option(title='Completions',
                       description='Visualisation to use for displaying the completions. (Multiple columns, one column, a toolbar or nothing.)',
                       get_current_value=lambda: self.completion_visualisation,
                       get_values=lambda: {
                           CompletionVisualisation.NONE: lambda: enable('completion_visualisation', CompletionVisualisation.NONE),
                           CompletionVisualisation.POP_UP: lambda: enable('completion_visualisation', CompletionVisualisation.POP_UP),
                           CompletionVisualisation.MULTI_COLUMN: lambda: enable('completion_visualisation', CompletionVisualisation.MULTI_COLUMN),
                           CompletionVisualisation.TOOLBAR: lambda: enable('completion_visualisation', CompletionVisualisation.TOOLBAR),
                       }),
                Option(title='Prompt',
                       description="Visualisation of the prompt. ('>>>' or 'In [1]:')",
                       get_current_value=lambda: self.prompt_style,
                       get_values=lambda: dict((s, partial(enable, 'prompt_style', s)) for s in self.all_prompt_styles)),
                simple_option(title='Blank line after output',
                              description='Insert a blank line after the output.',
                              field_name='insert_blank_line_after_output'),
                simple_option(title='Show signature',
                              description='Display function signatures.',
                              field_name='show_signature'),
                simple_option(title='Show docstring',
                              description='Display function docstrings.',
                              field_name='show_docstring'),
                simple_option(title='Show line numbers',
                              description='Show line numbers when the input consists of multiple lines.',
                              field_name='show_line_numbers'),
                simple_option(title='Show Meta+Enter message',
                              description='Show the [Meta+Enter] message when this key combination is required to execute commands. ' +
                                  '(This is the case when a simple [Enter] key press will insert a newline.',
                              field_name='show_meta_enter_message'),
                simple_option(title='Wrap lines',
                              description='Wrap lines instead of scrolling horizontally.',
                              field_name='wrap_lines'),
                simple_option(title='Show status bar',
                              description='Show the status bar at the bottom of the terminal.',
                              field_name='show_status_bar'),
                simple_option(title='Show sidebar help',
                              description='When the sidebar is visible, also show this help text.',
                              field_name='show_sidebar_help'),
                simple_option(title='Highlight parenthesis',
                              description='Highlight matching parenthesis, when the cursor is on or right after one.',
                              field_name='highlight_matching_parenthesis'),
            ]),
            OptionCategory('Colors', [
                simple_option(title='Syntax highlighting',
                              description='Use colors for syntax highligthing',
                              field_name='enable_syntax_highlighting'),
                simple_option(title='Swap light/dark colors',
                              description='Swap light and dark colors.',
                              field_name='swap_light_and_dark'),
                Option(title='Code',
                       description='Color scheme to use for the Python code.',
                       get_current_value=lambda: self._current_code_style_name,
                       get_values=lambda: dict(
                            (name, partial(self.use_code_colorscheme, name)) for name in self.code_styles)
                       ),
                Option(title='User interface',
                       description='Color scheme to use for the user interface.',
                       get_current_value=lambda: self._current_ui_style_name,
                       get_values=lambda: dict(
                            (name, partial(self.use_ui_colorscheme, name)) for name in self.ui_styles)
                       ),
                Option(title='Color depth',
                       description='Monochrome (1 bit), 16 ANSI colors (4 bit),\n256 colors (8 bit), or 24 bit.',
                       get_current_value=lambda: COLOR_DEPTHS[self.color_depth],
                       get_values=lambda: dict(
                           (name, partial(self._use_color_depth, depth)) for depth, name in COLOR_DEPTHS.items())
                       ),
                Option(title='Min brightness',
                       description='Minimum brightness for the color scheme (default=0.0).',
                       get_current_value=lambda: '%.2f' % self.min_brightness,
                       get_values=lambda: dict(
                           ('%.2f' % value, partial(self._set_min_brightness, value))
                            for value in brightness_values)
                       ),
                Option(title='Max brightness',
                       description='Maximum brightness for the color scheme (default=1.0).',
                       get_current_value=lambda: '%.2f' % self.max_brightness,
                       get_values=lambda: dict(
                           ('%.2f' % value, partial(self._set_max_brightness, value))
                            for value in brightness_values)
                       ),
            ]),
        ]
289372
def initialize_options(self):
        """"""
        self.dep_groups = ''
        self.dep_quote = False
        self.dep_conda = False
753741
def list_flag_option(name, description, **config)
      add_option Clin::OptionList.new(name, description, **config.merge(argument: false))
    end
1279814
def add_list_opt(self, opt, values):
        
        self.add_opt(opt)
        for val in values:
            self.add_opt(val)
359838
def options(self, glob=False, **args):
        
        kwargs = {}
        for argname, argarg in args.items():
            if argname == "sort":
                argarg = self._getPattern(argarg)
            if argname not in ["done", "undone"]:
                kwargs[argname] = argarg
        if "done" in args or "undone" in args:
            kwargs["done"] = self._getDone(
                args.get("done"), args.get("undone")
            )

        self.model.setOptions(glob=glob, **kwargs)
565993
def create_option_vip(self):
        """"""
        return OptionVIP(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
1337254
def get_create_options(self):
        """"""

        package = self._get_package()

        # Locations
        locations = []
        for region in package['regions']:
            locations.append({
                'name': region['location']['location']['longName'],
                'key': region['location']['location']['name'],
            })

        # Sizes
        sizes = []
        for preset in package['activePresets'] + package['accountRestrictedActivePresets']:
            sizes.append({
                'name': preset['description'],
                'key': preset['keyName']
            })

        # Operating systems
        operating_systems = []
        for item in package['items']:
            if item['itemCategory']['categoryCode'] == 'os':
                operating_systems.append({
                    'name': item['softwareDescription']['longDescription'],
                    'key': item['softwareDescription']['referenceCode'],
                })

        # Port speeds
        port_speeds = []
        for item in package['items']:
            if all([item['itemCategory']['categoryCode'] == 'port_speed',
                    # Hide private options
                    not _is_private_port_speed_item(item),
                    # Hide unbonded options
                    _is_bonded(item)]):
                port_speeds.append({
                    'name': item['description'],
                    'key': item['capacity'],
                })

        # Extras
        extras = []
        for item in package['items']:
            if item['itemCategory']['categoryCode'] in EXTRA_CATEGORIES:
                extras.append({
                    'name': item['description'],
                    'key': item['keyName']
                })

        return {
            'locations': locations,
            'sizes': sizes,
            'operating_systems': operating_systems,
            'port_speeds': port_speeds,
            'extras': extras,
        }
634898
function createOptions( options ) {
	var object = optionsCache[ options ] = {};
	jQuery.each( options.split( core_rspace ), function( _, flag ) {
		object[ flag ] = true;
	});
	return object;
}
848721
def add_option(self, option):
        
        assert isinstance(option, Option)
        repeatable = defines.OptionRegistry.LIST[option.number].repeatable
        if not repeatable:
            ret = self._already_in(option)
            if ret:
                raise TypeError("Option : %s is not repeatable", option.name)
            else:
                self._options.append(option)
        else:
            self._options.append(option)
901705
def __create_lists_for_nav_bar(self):
        """"""
        
        nav_bar_section = []
        nav_bar_section_page = []
        for key in self.sections:
            nav_bar_section.append(key)
            nav_bar_page = []
            for page in self.sections[key].pages:
                nav_bar_page.append(page)
            nav_bar_section_page.append(nav_bar_page)
        
        nav_bar_section_page_len = [len(x) for x in nav_bar_section_page]
        
        self.nav_bar_section_page = nav_bar_section_page # create a variable for later
        
        # nav_bar_page is a list of lists
        return nav_bar_section, nav_bar_section_page, nav_bar_section_page_len
593232
def build_option(args={})
      options << Option.new(args.merge(group: self))
      options.last
    end
152097
function createOptions( options ) {
	var object = optionsCache[ options ] = {};
	jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
		object[ flag ] = true;
	});
	return object;
}
688061
function Options(options) {
  if (!(this instanceof Options)) {
    return new Options(options);
  }
  this.defaults = this.defaults || {};
  this.options = this.options || {};
  if (options) {
    this.option(options);
  }
}
410969
function(opt){
        // merge with default options
        Object.keys(_options).forEach(function(key){
            _options[key] = opt[key] || _options[key];
        });
    }
742475
function listInstances(search_opts, callback) {
    if (arguments.length === 1) {
        callback = search_opts;
        search_opts = {};
    }

    var uri = '/instances?' + qs.stringify(search_opts);
    return (this.get(uri, callback));
}
250451
def _build_default_options(self):
        "
        return [
            OptionDefault('model', None, inherit=True),
            OptionDefault('abstract', False, inherit=False),
            OptionDefault('strategy', enums.CREATE_STRATEGY, inherit=True),
            OptionDefault('inline_args', (), inherit=True),
            OptionDefault('exclude', (), inherit=True),
            OptionDefault('rename', {}, inherit=True),
        ]
526889
def prepare_options(opts = [])
      opts.inject('') do |string, (option, value)|
        string += case
                  when value
                    create_option(option, value)
                  when option.respond_to?(:each_pair)
                    prepare_options(option)
                  else
                    create_option(option)
                  end
      end
    end