Check if this device has a given button.

		Args:
			button (int): Button to check for, see ``input.h`` for button
				definitions.
		Returns:
			bool: :obj:`True` if the device has this button, :obj:`False` if
			it does not.
		Raises:
			AssertionError
766971
def has_button(self, button):
		

		rc = self._libinput.libinput_device_pointer_has_button(
			self._handle, button)
		assert rc >= 0, 'This device is not a pointer device'
		return bool(rc)
754525
public boolean onDoubleClick(MouseButton button)
	{
		if (!isEnabled())
			return false;

		return parent != null ? parent.onDoubleClick(button) : false;
	}
57228
def update_button_status(self):
        
        # enable/disable ok button
        if len(self.displaced.currentField()) > 0:
            self.button_box.button(
                QtWidgets.QDialogButtonBox.Ok).setEnabled(True)
        else:
            self.button_box.button(
                QtWidgets.QDialogButtonBox.Ok).setEnabled(False)
7931
def _has_x(self, kwargs):
        ''''''
        return (('x' in kwargs) or (self._element_x in kwargs) or
                (self._type == 3 and self._element_1mx in kwargs))
640283
def press(button, scope={})
      in_scope(scope) do
        begin
          click_button(button)
        rescue Capybara::ElementNotFound
          raise Kelp::MissingButton,
            "No button with value, id or text '#{button}' found"
        end
      end
    end
495131
def _is_inline(button):
        
        return isinstance(button, (
            types.KeyboardButtonCallback,
            types.KeyboardButtonSwitchInline,
            types.KeyboardButtonUrl
        ))
429040
def on_button_press(self, event):
        
        if not event.get_button()[1] == 1:  # left mouse button
            return False
        view = self.view

        item, handle = HandleFinder(view.hovered_item, view).get_handle_at_point((event.x, event.y))

        if not handle:  # Require a handle
            return False

        # Connection handle must belong to a port and the MOVE_PORT_MODIFIER must not be pressed
        if not isinstance(item, StateView) or handle not in [port.handle for port in item.get_all_ports()] or (
                    event.get_state()[1] & constants.MOVE_PORT_MODIFIER):
            return False

        for port in item.get_all_ports():
            if port.handle is handle:
                self._start_port_v = port
                if port in item.get_logic_ports():
                    self._is_transition = True
                if port is item.income or isinstance(port, InputPortView) or port in item.scoped_variables:
                    self._parent_state_v = port.parent
                elif port.parent.parent:
                    self._parent_state_v = port.parent.parent
                else:  # Outgoing port of the root state was clicked on, no connection can be drawn here
                    self._parent_state_v = None

        return True
720822
private boolean shouldPositiveButtonBeShown() {
        SharedPreferences sharedPreferences =
                PreferenceManager.getDefaultSharedPreferences(getActivity());
        String key = getString(R.string.show_positive_button_preference_key);
        boolean defaultValue =
                getResources().getBoolean(R.bool.show_positive_button_preference_default_value);
        return sharedPreferences.getBoolean(key, defaultValue);
    }
966028
private function hasPasteNewButton()
    {
        $environment     = $this->environment;
        $basicDefinition = $environment->getDataDefinition()->getBasicDefinition();

        return ((true === (bool) ViewHelpers::getManualSortingProperty($environment))
                && (true === empty($this->clipboardItems))
                && (false === $this->isHierarchical())
                && ($basicDefinition->isEditable() && $basicDefinition->isCreatable()));
    }
1069555
def button_clicked(self, button):
        
        if button is self.idx_ok:

            chans = self.get_channels()
            group = self.one_grp
            cycle = self.get_cycles()
            stage = self.idx_stage.selectedItems()
            params = {k: v.get_value() for k, v in self.index.items()}
            name = self.name.get_value()

            if None in [params['f1'], params['f2']]:
                self.parent.statusBar().showMessage(
                        'Specify bandpass frequencies')
                return

            if params['max_dur'] is None:
                self.parent.statusBar().showMessage('Specify maximum duration')
                return
            elif params['max_dur'] >= 30:
                self.parent.statusBar().showMessage(
                        'Maximum duration must be below 30 seconds.')
                return

            if stage == []:
                stage = None
            else:
                stage = [x.text() for x in self.idx_stage.selectedItems()]

            chan_full = None
            reject_artf = False
            if params['excl_event'] == 'channel-specific':
                chan_full = [i + ' (' + self.idx_group.currentText() + ''
                           ')' for i in chans]
                chans = None
                reject_artf = True
            elif params['excl_event'] == 'from any channel':
                reject_artf = True
            
            data = fetch(self.parent.info.dataset, 
                          self.parent.notes.annot, cat=(1, 1, 1, 0),
                          stage=stage, cycle=cycle, 
                          chan_full=chan_full, min_dur=params['min_seg_dur'], 
                          reject_epoch=params['excl_epoch'], 
                          reject_artf=reject_artf)
            
            if not data.segments:
                msg = 'No valid signal found.'
                error_dialog = QErrorMessage(self)
                error_dialog.setWindowTitle('Error fetching data')
                error_dialog.showMessage(msg)
                return
            
            ding = data.read_data(chans, group['ref_chan'], group['name'],
                                  parent=self)
            
            if not ding:
                self.parent.statusBar().showMessage('Process interrupted.')
                return

            data = data[0]['data']
            
# =============================================================================
#             if params['resample']:                
#                 rs_freq = params['rs_freq']
#                 ratio = rs_freq / data.s_freq
#                 up = Fraction(ratio).numerator
#                 dn = Fraction(ratio).denominator
#                 
#                 rs_dat = zeros((data.number_of('chan')[0], 
#                                 int(data.number_of('time')[0] * ratio)))
#                 
#                 for i in range(data.number_of('chan')[0]):                    
#                     rs_dat[i, :] = resample_poly(data.data[0][i], up, dn)
#                          
#                 data.data[0] = rs_dat
#                 data.s_freq = rs_freq
#                 start_time = data.axis['time'][0][0]
#                 end_time = data.axis['time'][0][-1]
#                 data.axis['time'][0] = arange(start_time, end_time, 
#                          1 / rs_freq)
#                 lg.info(str(data.data.shape))
#                 lg.info(str(data.data[0].shape))
#                 lg.info(str(data.data[0][0].shape))
#                 lg.info(str(data.axis['time'].shape))
#                 lg.info(str(data.s_freq))
# =============================================================================
            
            if params['prep_filt']:
                low_cut = params['prep_lc']
                high_cut = params['prep_hc']
                data = filter_(data, axis='time', low_cut=low_cut, 
                               high_cut=high_cut)
            
            if params['detrend']:
                data = math(data, operator_name='detrend', axis='time')            
            
            self.parent.notes.detect_events(data, self.method, 
                                            params, label=name)

            self.accept()

        if button is self.idx_cancel:
            self.reject()
225492
def has_key(self, key):
        
        if key in self._dict:
            try: 
                self[key]
                return True
            except ValueError:
                return False
            except KeyError:
                return False
        return False
232291
private void checkAndEnableSaveButton() {
		boolean enabled = true;
		enabled &= txt_PubCert.getDocument().getLength() > MIN_CERT_LENGTH;
		bt_save.setEnabled(enabled);
	}
523040
function (aButtons) {
			var iButtonsEnabled = 0;
			for (var i = 0; i < aButtons.length; i++) {
				if (aButtons[i].getEnabled()) {
					iButtonsEnabled++;
					if (!this._iFirstVisibleButtonIndex) {
						this._iFirstVisibleButtonIndex = i;
					}
				}
			}

			return iButtonsEnabled;
		}
451984
private void checkAndEnableViewButton() {
		boolean enabled = true;
		enabled &= Desktop.isDesktopSupported();
		enabled &= txt_PubCert.getDocument().getLength() > MIN_CERT_LENGTH;
		bt_view.setEnabled(enabled);
	}
877148
def buttons_pressed(self):
        
        for b in self._buffer_cache:
            fcntl.ioctl(self._button_file(b), self.EVIOCGKEY, self._buffer_cache[b])

        pressed = []
        for k, v in self._buttons.items():
            buf = self._buffer_cache[v['name']]
            bit = v['value']

            if bool(buf[int(bit / 8)] & 1 << bit % 8):
                pressed.append(k)

        return pressed
727323
def checkbutton_with_label(self, description):
        
        act_btn = Gtk.CheckButton(description)
        align = self.create_alignment()
        act_btn.add(align)
        return align
367889
def is_pointer(self):
		

		if self in {type(self).POINTER_MOTION, type(self).POINTER_BUTTON,
			type(self).POINTER_MOTION_ABSOLUTE, type(self).POINTER_AXIS}:
			return True
		else:
			return False