Helper for checkbox
488017
private function getCheckboxChecked( $option )
    {
        $fieldElements = $this->getXpath()->findFields( $option );
        EzAssertion::assertElementFound( $option, $fieldElements, null, 'checkbox' );

        // this is needed for the cases where are checkboxes and radio's
        // side by side, for main option the radio and the extra being the
        // checkboxes values
        if ( strtolower( $fieldElements[0]->getAttribute( 'type' ) ) !== 'checkbox' )
        {
            $value = $fieldElements[0]->getAttribute( 'value' );
            $fieldElements = $this->getXpath()->findXpath( "//input[@type='checkbox' and @value='$value']" );
            EzAssertion::assertElementFound( $value, $fieldElements, null, 'checkbox' );
        }

        return $isChecked = ( $fieldElements[0]->getAttribute( 'checked' ) ) === 'true';
    }
158687
function checkboxHandler (event) {
    const target = event.target;

    if (target.checked) {
      link.style.display = 'none';
      if (upload.value) {
        upload.value = '';
        link = clear(link);
      }
    }
    else {
      link.style.display = '';
    }
  }
501965
def _check_box_toggled(self, widget, data=None):
        
        active = widget.get_active()
        arg_name = data

        if 'entry' in self.args[arg_name]:
            self.args[arg_name]['entry'].set_sensitive(active)
        if 'browse_btn' in self.args[arg_name]:
            self.args[arg_name]['browse_btn'].set_sensitive(active)

        self.path_window.show_all()
1158418
function (selector) {
            try {
                var jqElem = $(selector);
            } catch (e) {
                return null;
            }
            if (jqElem.length === 0) {
                return null;
            } else if (jqElem.is('input[type="checkbox"]')) {
                return (jqElem.prop('checked') === true ? true : false);
            } else if (jqElem.is('input[type="radio"]') && jqElem.attr('name') !== undefined) {
                return $('input[name="' + jqElem.attr('name') + '"]:checked').val();
            } else if (jqElem.prop('value') !== undefined) {
                return jqElem.val();
            } else {
                return jqElem.html();
            }
        }
552322
function setCheckboxState(page, ph, selectorAndState, callback) {
    page.evaluate(function (selectorAndState) {
        try {
            var selector = selectorAndState[0];
            var state = selectorAndState[1];
            var element = document.querySelector(selector);
            element.checked = state;

            // event is needed because listeners to the change do not react to
            // programmatic changes
            var event = document.createEvent('Event');
            event.initEvent('change', true, false);
            element.dispatchEvent(event);
            return null;
        } catch (error) {
            return error;
        }
    }, function (error) {
        // do this because if there is no error, the error is still something so we can't simply do callback(error, page, ph);
        if (error) {
            callback(error, page, ph);
            return;
        }
        callback(null, page, ph);
    }, selectorAndState);
}
1099722
def generate_checker(value):
    """"""
    @property
    @wraps(can_be_)
    def checker(self):
        return self.can_be_(value)

    return checker
691914
function SettingsCheckbox( params, node ){
		makeLocalCheckbox(params);
		Checkbox.apply(this, arguments);
		this.mylabel = lib.$(".setting-label", this.node); //$NON-NLS-0$
		this.mycontrol = lib.$(".setting-control", this.node); //$NON-NLS-0$
	}
732076
def input_check(self, name, label, multi_line=False):
        
        lines = list()
        lines.append('{%% if %s %%}' % name)
        lines.append(self.tab + '{% set checked = "checked" %}')
        lines.append('{% else %}')
        lines.append(self.tab  + '{% set checked = "" %}')
        lines.append('{% endif %}')
        if multi_line:
            line_break = "<br>"
        else:
            line_break = ""
        lines.append('<input type="checkbox" name="%s" value="%s" {{checked}}> %s %s' % (name, name, label, line_break))        
        return "\n".join(lines)
795917
def collection_check_boxes2(method, collection, value_method, text_method, options = {}, html_options = {})
      html_options ||= {}
      html_options[:multiple] = 'multiple'
      collection_select2 method, collection, value_method, text_method, options, html_options
    end
415056
def render(self, name, value, attrs=None, renderer=None):
        
        wrapped = self.widget.render(name, value, attrs, renderer)
        checkbox_name = self.clear_checkbox_name(name)
        checkbox_id = self.clear_checkbox_id(checkbox_name)
        checkbox_label = self.clear_checkbox_label
        checkbox = self.checkbox.render(
            checkbox_name,
            value == self.empty_value,
            attrs={'id': checkbox_id},
            renderer=renderer)
        return mark_safe(self.template.format(
            conditional_escape(wrapped),
            conditional_escape(checkbox_id),
            conditional_escape(checkbox_label),
            conditional_escape(checkbox)))
970684
function createTodoElement(item) {
        var template = $('#todo-item-template').html();
        var element = $(template);
        element.find(':checkbox')[0].checked = item.done;
        element.find('span').text(item.name);
        return element;
    }
186201
function initCheckBox(elem, parsed){
  var self = this;
  var watcher = this.$watch(parsed, function(newValue){
    dom.attr(elem, 'checked', !!newValue);
  }, STABLE);

  var handler = function handler(){
    var value = this.checked;
    parsed.set(self, value);
    watcher.last = value;
    self.$update();
  }
  if(parsed.set) dom.on(elem, "change", handler)

  if(parsed.get(self) === undefined){
    parsed.set(self, !!elem.checked);
  }

  return function destroy(){
    if(parsed.set) dom.off(elem, "change", handler)
  }
}
490119
def make_check_box(checked:, text:)
      box_y = cursor
      bounding_box [0, box_y], width: 7, height: 7 do
        stroke_bounds
        if checked
          move_down 1
          text 'X', align: :center, size: 6, style: :bold
        end
      end
      bounding_box [9, box_y], width: bounds.width - 9, height: 10 do
        text text, size: 10
      end
    end
1237721
function() {
        var value = '';
        this.$group.each(function(index, element) {
            if (element.checked) {
                value = $(element).val();
                return false;
            }
        });
        return value;
    }
585629
def checkbox_check(self, force_check=False):
        
        if not self.get_attribute('checked'):
            self.click(force_click=force_check)
547548
function(value) {
            this.$input.prop('checked', false);
            if($.isArray(value) && value.length) {
               this.$input.each(function(i, el) {
                   var $el = $(el);
                   // cannot use $.inArray as it performs strict comparison
                   $.each(value, function(j, val){
                       /*jslint eqeq: true*/
                       if($el.val() == val) {
                       /*jslint eqeq: false*/                           
                           $el.prop('checked', true);
                       }
                   });
               }); 
            }  
        }
12942
protected function checkBox()
	{
		$attribute = $this->attribute;
		list($hidden, $checkbox) = $this->getSeparatedSelectableInput();

		echo '<div class="controls">';
		echo ($hidden) ? $hidden . PHP_EOL : '';
		echo '<label class="checkbox" for="' . $this->getAttributeId($attribute) . '">';
		echo $checkbox . PHP_EOL;
		echo $this->model->getAttributeLabel($attribute);
		echo $this->getError() . $this->getHint();
		echo '</label></div>';
	}