Configure resources of the Scale widget.
492193
def config_scale(self, cnf={}, **kwargs):
        """"""
        self._scale.config(cnf, **kwargs)
        # Update self._variable limits in case the ones of the scale have changed
        self._variable.configure(high=self._scale['to'],
                                 low=self._scale['from'])
        if 'orient' in cnf or 'orient' in kwargs:
            self._grid_widgets()
49793
protected function configure()
    {
        $this
            ->setDescription('Configure an index')
            ->addArgument(
                'app-name',
                InputArgument::REQUIRED,
                'App name'
            )
            ->addArgument(
                'index-name',
                InputArgument::REQUIRED,
                'Index'
            )
            ->addOption(
                'language',
                null,
                InputOption::VALUE_OPTIONAL,
                'Index language',
                null
            )
            ->addOption(
                'no-store-searchable-metadata',
                null,
                InputOption::VALUE_NONE,
                'Store searchable metadata'
            )
            ->addOption(
                'synonym',
                null,
                InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
                'Synonym'
            )
            ->addOption(
                'synonyms-file',
                null,
                InputOption::VALUE_OPTIONAL,
                'Synonyms file'
            )
            ->addOption(
                'shards',
                null,
                InputOption::VALUE_OPTIONAL,
                'Shards for the index',
                Config::DEFAULT_SHARDS
            )
            ->addOption(
                'replicas',
                null,
                InputOption::VALUE_OPTIONAL,
                'Replicas for the index',
                Config::DEFAULT_REPLICAS
            );
    }
925429
def _scale(self, resource):
        
        original_width, original_height = resource.size

        target_width = int(round(original_width * self.value))
        target_height = int(round(original_height * self.value))

        resource_format = resource.format
        resource = resource.resize((target_width, target_height), Image.ANTIALIAS)
        resource.format = resource_format

        return resource
182443
def set_widgets(self):
        """"""
        self.tvBrowserHazard_selection_changed()

        # Set icon
        hazard = self.parent.step_fc_functions1.selected_value(
            layer_purpose_hazard['key'])
        icon_path = get_image_path(hazard)
        self.lblIconIFCWHazardFromBrowser.setPixmap(QPixmap(icon_path))
323414
def set_subresources(self, **kwargs):
        """"""
        for attribute_name, resource in self._subresource_map.items():
            sub_attr = kwargs.get(attribute_name)
            if sub_attr is None:
                # Attribute was not found or is null
                value = None
            elif isinstance(sub_attr, list):
                # A list of subresources is supported
                value = [resource(**x) for x in sub_attr]
            else:
                # So is a single resource
                value = resource(**sub_attr)
            setattr(self, attribute_name, value)
1372597
def do_setDesiredCapacity(self,args):
        """"""
        parser = CommandArgumentParser("setDesiredCapacity")
        parser.add_argument(dest='value',type=int,help='new value');
        args = vars(parser.parse_args(args))

        value = int(args['value'])
        print "Setting desired capacity to {}".format(value)
        client = AwsConnectionFactory.getAsgClient()
        client.set_desired_capacity(AutoScalingGroupName=self.scalingGroup,DesiredCapacity=value,HonorCooldown=True)
        print "Scaling activity in progress"
269486
def _configure_manager(self):
        
        self._manager = ContainerManager(self, resource_class=Container,
                response_key="", uri_base="")
1168402
def set_scale(self, scale):
        
        register = self.MMA8452Q_Register['XYZ_DATA_CFG']
        self.board.i2c_read_request(self.address, register, 1,
                                    Constants.I2C_READ | Constants.I2C_END_TX_MASK,
                                    self.data_val, Constants.CB_TYPE_DIRECT)


        config_reg = self.wait_for_read_result()
        config_reg = config_reg[self.data_start]
        config_reg &= 0xFC  # Mask out scale bits
        config_reg |= (scale >> 2)
        self.board.i2c_write_request(self.address, [register, config_reg])
547297
private void buildGui() {
		initWidget(UI_BINDER.createAndBindUi(this));
		zoomInElement.getElement().setInnerText("+");
		zoomOutElement.getElement().setInnerText("-");
		getElement().getStyle().setPosition(Position.ABSOLUTE);
		getElement().getStyle().setTop(5, Unit.PX);
		getElement().getStyle().setLeft(5, Unit.PX);

		if (Dom.isTouchSupported()) {
			initializeForTouchDevice();
		} else {
			initializeForDesktop();
		}
	}
846549
def set_widgets(self):
        """"""
        self.extent_dialog = ExtentSelectorDialog(
            self.parent.iface,
            self.parent.iface.mainWindow(),
            extent=self.parent.dock.extent.user_extent,
            crs=self.parent.dock.extent.crs)
        self.extent_dialog.tool.rectangle_created.disconnect(
            self.extent_dialog.stop_capture)
        self.extent_dialog.clear_extent.connect(
            self.parent.dock.extent.clear_user_analysis_extent)
        self.extent_dialog.extent_defined.connect(
            self.parent.dock.define_user_analysis_extent)
        self.extent_dialog.capture_button.clicked.connect(
            self.start_capture_coordinates)
        self.extent_dialog.tool.rectangle_created.connect(
            self.stop_capture_coordinates)

        self.extent_dialog.label.setText(tr(
            'Please specify extent of your analysis:'))

        if self.swExtent:
            self.swExtent.hide()

        self.swExtent = self.extent_dialog.main_stacked_widget
        self.layoutAnalysisExtent.addWidget(self.swExtent)
1031876
def setup_ui(self, ):
        
        grid = QtGui.QGridLayout(self)
        self.setLayout(grid)
        self.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        self.splitter = QtGui.QSplitter(QtCore.Qt.Horizontal, self)
        grid.addWidget(self.splitter)
        grid.setContentsMargins(0, 0, 0, 0)
673762
protected void setMapScaleBar() {
        String value = this.sharedPreferences.getString(SETTING_SCALEBAR, SETTING_SCALEBAR_BOTH);

        if (SETTING_SCALEBAR_NONE.equals(value)) {
            AndroidUtil.setMapScaleBar(this.mapView, null, null);
        } else {
            if (SETTING_SCALEBAR_BOTH.equals(value)) {
                AndroidUtil.setMapScaleBar(this.mapView, MetricUnitAdapter.INSTANCE, ImperialUnitAdapter.INSTANCE);
            } else if (SETTING_SCALEBAR_METRIC.equals(value)) {
                AndroidUtil.setMapScaleBar(this.mapView, MetricUnitAdapter.INSTANCE, null);
            } else if (SETTING_SCALEBAR_IMPERIAL.equals(value)) {
                AndroidUtil.setMapScaleBar(this.mapView, ImperialUnitAdapter.INSTANCE, null);
            } else if (SETTING_SCALEBAR_NAUTICAL.equals(value)) {
                AndroidUtil.setMapScaleBar(this.mapView, NauticalUnitAdapter.INSTANCE, null);
            }
        }
    }
955248
public void setScale(double scaleX, double scaleY, double scaleZ) {
		this.scaleX = scaleX;
		this.scaleY = scaleY;
		this.scaleZ = scaleZ;
	}
702133
private void buildConfigOptions() {
		WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
		layout.setMargin(new Margin(null, null, Size.LARGE, null));
		layout.addField("Select a WPanel Type", panelType);
		contentField = layout.addField("Panel content", panelContent);
		headingField = layout.addField("heading", tfHeading);
		showMenuField = layout.addField("Show menu", showMenu);
		showUtilBarField = layout.addField("Show utility bar", showUtilBar);
		layout.addField((WLabel) null, applyConfigButton);
		add(layout);
	}
1118490
def init_app(self, app, **kwargs):
        """"""
        self.kwargs.update(kwargs)
        self.settings = self.dynaconf_instance or LazySettings(**self.kwargs)
        app.config = self.make_config(app)
        app.dynaconf = self.settings
149635
def Build_ConfigPanel(self):
        """"""
        panel = self.config_panel
        sizer = wx.BoxSizer(wx.VERTICAL)

        lsty = wx.ALIGN_LEFT|wx.LEFT|wx.TOP|wx.EXPAND

        if self.config_mode == 'rgb':
            for icol, col in enumerate(RGB_COLORS):
                self.cmap_panels[icol] =  ColorMapPanel(self.config_panel,
                                                       self.panel,
                                                       title='%s: ' % col.title(),
                                                       color=icol,
                                                       default=col,
                                                       colormap_list=None)

                sizer.Add(self.cmap_panels[icol], 0, lsty, 2)

                sizer.Add(wx.StaticLine(self.config_panel, size=(100, 2),
                                        style=wx.LI_HORIZONTAL), 0, lsty, 2)

            self.interp_panel = InterpPanel(self.config_panel,
                                            callback=self.onInterp)
            self.contrast_panel = ContrastPanel(self.config_panel,
                                            callback=self.set_contrast_levels)

            sizer.Add(self.interp_panel, 0, lsty, 2)
            sizer.Add(self.contrast_panel, 0, lsty, 2)


        else:
            self.cmap_panels[0] =  ColorMapPanel(self.config_panel,
                                                 self.panel,
                                                 default='gray',
                                                 colormap_list=ColorMap_List)
            self.interp_panel = InterpPanel(self.config_panel,
                                            callback=self.onInterp)
            self.contrast_panel = ContrastPanel(self.config_panel,
                                            callback=self.set_contrast_levels)

            sizer.Add(self.cmap_panels[0],  0, lsty, 1)
            sizer.Add(wx.StaticLine(self.config_panel, size=(100, 2),
                                    style=wx.LI_HORIZONTAL), 0, lsty, 2)
            sizer.Add(self.interp_panel, 0, lsty, 2)
            sizer.Add(self.contrast_panel, 0, lsty, 2)

        cust = self.CustomConfig(self.config_panel, None, 0)
        if cust is not None:
            sizer.Add(cust, 0, lsty, 1)
        pack(self.config_panel, sizer)
246500
private static void doLayout(
            final Graphics2D graphics2d, final ScalebarAttributeValues scalebarParams,
            final ScaleBarRenderSettings settings) {
        final Dimension maxLabelSize = getMaxLabelSize(settings);

        int numSubIntervals = 1;
        if (scalebarParams.subIntervals) {
            numSubIntervals = getNbSubIntervals(
                    settings.getScaleUnit(), settings.getIntervalLengthInWorldUnits(),
                    settings.getIntervalUnit());
        }

        settings.setBarSize(getBarSize(settings));
        settings.setLabelDistance(getLabelDistance(settings));
        settings.setLineWidth(getLineWidth(settings));
        settings.setSize(getSize(scalebarParams, settings, maxLabelSize));
        settings.setMaxLabelSize(maxLabelSize);
        settings.setNumSubIntervals(numSubIntervals);

        ScalebarDrawer drawer = scalebarParams.getType().createDrawer(graphics2d, settings);
        drawer.draw();
    }