Event handler for end of output type choice
420529
def OnGridEditorClosed(self, event):
        """"""

        try:
            dialect, self.has_header = \
                self.parent.csvwidgets.get_dialect()
        except TypeError:
            event.Skip()
            return 0

        self.fill_cells(dialect, self.has_header, choices=False)
64107
def endElement(self, name):
        
        if name in self.ignore_end:
            return
        try:
            handler = getattr(self, '_handle_end_%s' % name)
        except AttributeError:
            raise KeyError("Unknown element end '%s'" % name)
        handler()
584675
def _blob_end_handler_factory():
    """"""
    def expand_res(res):
        if res is None:
            return 0, 0
        return res

    def action(c, ctx, prev, res, is_first):
        num_digits, num_pads = expand_res(res)
        if c in _BASE64_DIGITS:
            if prev == _CLOSE_BRACE or prev == _BASE64_PAD:
                _illegal_character(c, ctx.set_ion_type(IonType.BLOB))
            num_digits += 1
        elif c == _BASE64_PAD:
            if prev == _CLOSE_BRACE:
                _illegal_character(c, ctx.set_ion_type(IonType.BLOB))
            num_pads += 1
        else:
            _illegal_character(c, ctx.set_ion_type(IonType.BLOB))
        ctx.value.append(c)
        return num_digits, num_pads

    def validate(c, ctx, res):
        num_digits, num_pads = expand_res(res)
        if num_pads > 3 or (num_digits + num_pads) % 4 != 0:
            _illegal_character(c, ctx, 'Incorrect number of pad characters (%d) for a blob of %d base-64 digits.'
                               % (num_pads, num_digits))

    return _lob_end_handler_factory(IonType.BLOB, action, validate)
79200
function handleBrushEnd() {
            if (!d3Selection.event.sourceEvent) {
                return; // Only transition after input.
            }

            let dateExtentRounded = [null, null];
            const selection = d3Selection.event.selection;

            if (selection) {
                let dateExtent = selection.map(xScale.invert);

                dateExtentRounded = dateExtent.map(timeIntervals[roundingTimeInterval].round);

                // If empty when rounded, use floor & ceil instead.
                if (dateExtentRounded[0] >= dateExtentRounded[1]) {
                    dateExtentRounded[0] = timeIntervals[roundingTimeInterval].floor(dateExtent[0]);
                    dateExtentRounded[1] = timeIntervals[roundingTimeInterval].offset(dateExtentRounded[0]);
                }

                d3Selection.select(this)
                    .transition()
                    .call(d3Selection.event.target.move, dateExtentRounded.map(xScale));
            }

            dispatcher.call('customBrushEnd', this, dateExtentRounded);
        }
1277199
def handle_output(results, output_type, action):
    """"""
    if output_type == 'QUIET':
        return

    if not output_type == 'JSON':
        if action == 'list':
            table = generate_list_table_result(
                logger, results, output_type == 'TABLE-NO-HEADER')
        else:
            table = generate_table_results(results, output_type == 'TABLE-NO-HEADER')
        if table:
            print(table)
    else:
        try:
            json_str = json.dumps(results)
            if json_str:
                print(json_str)
        except TypeError:
            logger.debug('Output is not JSON serializable, and then cannot '
                         'be printed with --output=JSON parameter.')
1367889
def handle_output(self, workunit, label, s):
    """"""
    if not self.is_under_main_root(workunit):
      return
    tool_output_format = self._get_tool_output_format(workunit)
    if tool_output_format == ToolOutputFormat.INDENT:
      self.emit(self._prefix(workunit, s))
    elif tool_output_format == ToolOutputFormat.UNINDENTED:
      self.emit(s)
    self.flush()
1086712
function endDialog(success, config) {
    if (success) {
        createConfigFile(config);
        console.log();
        process.stdout.write('Succesfully configured gas');
        checkbox.display('green');
        process.exit(0);
    } else {
        console.log(`Only 'y' and 'n' are accepted inputs.`);
        process.stdout.write('Failed to configure gas');
        checkbox.display('red');
        process.exit(1);
    }
}
266968
def end_hook(hook, status, output)
      # Want to print the header for quiet hooks only if the result wasn't good
      # so that the user knows what failed
      print_header(hook) if (!hook.quiet? && !@config['quiet']) || status != :pass

      print_result(hook, status, output)
    end
701673
def capture_output(self, with_hook=True):
        """"""
        self.hooked = ''

        def display_hook(obj):
            # That's some dirty hack
            self.hooked += self.safe_better_repr(obj)
            self.last_obj = obj

        stdout, stderr = sys.stdout, sys.stderr
        if with_hook:
            d_hook = sys.displayhook
            sys.displayhook = display_hook

        sys.stdout, sys.stderr = StringIO(), StringIO()
        out, err = [], []
        try:
            yield out, err
        finally:
            out.extend(sys.stdout.getvalue().splitlines())
            err.extend(sys.stderr.getvalue().splitlines())
            if with_hook:
                sys.displayhook = d_hook

            sys.stdout, sys.stderr = stdout, stderr
154691
function endsWithString(endingValue, valueToTest) {
  const position = valueToTest.length - endingValue.length;
  const lastIndexOfValue = valueToTest.lastIndexOf(endingValue);

  return !!~lastIndexOfValue && lastIndexOfValue === position;
}
241199
function end() {
		var err
		var args = Array.prototype.slice.call(arguments)
		var cb = typeof args[args.length - 1] === 'function' ? args.pop() : null
		if (self.writable && args.length) write.apply(this, args.concat(afterWrite))
		else afterWrite()

		function afterWrite(e) {
			if (e) err = e
			destroy(afterDestroy)
		}

		function afterDestroy(e) {
			if (e && !err) err = e
			if (cb) {
				var cbArgs = []
				if (err) cbArgs.push(err)
				cb.apply(this, cbArgs)
			}
		}
	}
1261786
function eventEnd ( event, data ) {

            // The handle is no longer active, so remove the class.
            if ( scope_ActiveHandle ) {
                removeClass(scope_ActiveHandle, options.cssClasses.active);
                scope_ActiveHandle = false;
            }

            // Remove cursor styles and text-selection events bound to the body.
            if ( event.cursor ) {
                document.body.style.cursor = '';
                document.body.removeEventListener('selectstart', document.body.noUiListener);
            }

            // Unbind the move and end events, which are added on 'start'.
            document.documentElement.noUiListeners.forEach(function( c ) {
                document.documentElement.removeEventListener(c[0], c[1]);
            });

            // Remove dragging class.
            removeClass(scope_Target, options.cssClasses.drag);

            setZindex();

            data.handleNumbers.forEach(function(handleNumber){
                fireEvent('set', handleNumber);
                fireEvent('change', handleNumber);
                fireEvent('end', handleNumber);
            });
        }
527084
private void checkEnd() {
    if (ended && !closed && children == 0) {
      closed = true;
      connection.doBatchEnd(id, endArgs);
      if (endHandler != null) {
        endHandler.handle((Void) null);
      }
    }
  }
1122669
function truncateLogOutput(output, maxLength) {
  if (typeof(maxLength) === 'undefined') maxLength = maxOutputLength;
  if (! output) return(output);

  if (typeof(output) !== 'string') output = output.toString();
  var length = output.length;
  if ((! length) || (length < (maxLength + 3))) return(output);

  var prefix = Math.ceil((maxLength - 3)/2);
  var suffix = Math.floor((maxLength - 3)/2);
  return(output.slice(0, prefix)+ '...' +
    output.slice(length-suffix));
}
756998
def show(cls, result):
        
        if result.ok:
            if result.stdout:
                out = '\n'.join(result.stdout)
                if result.value and result.value != '()':
                    return '\n'.join([out, result.value])
                return out
            if result.value and not cls._is_function_value(result.value):
                return result.value
            return cls.show_type(result)
        return result.value
211805
def program_end_action(self, text, loc, arg):
        """"""
        exshared.setpos(loc, text)
        if DEBUG > 0:
            print("PROGRAM_END:",arg)
            if DEBUG == 2: self.symtab.display()
            if DEBUG > 2: return
        index = self.symtab.lookup_symbol("main",SharedData.KINDS.FUNCTION)
        if index == None:
            raise SemanticException("Undefined reference to 'main'", False)
        elif self.symtab.get_type(index) != SharedData.TYPES.INT:
            self.warning("Return type of 'main' is not int", False)
887199
protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
         if ("FINISHED".equals(EVENT_TYPE)) {
            if ( gauge.isHighlightSections() ) {
                redraw();
            }
        } else if ("ANGLE".equals(EVENT_TYPE)) {
            double currentValue = (needleRotate.getAngle() + START_ANGLE - 180) / angleStep + gauge.getMinValue();
            lcdText.setText((String.format(locale, formatString, currentValue)));
            if (gauge.isLcdVisible()) {
                lcdText.setAlignment(Pos.CENTER_RIGHT);
                lcdText.setTranslateX((width - lcdText.getPrefWidth()) * 0.5);
            } else {
                lcdText.setAlignment(Pos.CENTER);
                lcdText.setTranslateX((width - lcdText.getLayoutBounds().getWidth()) * 0.5);
            }
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            enableNode(ledCanvas, gauge.isLedVisible());
            enableNode(titleText, !gauge.getTitle().isEmpty());
            enableNode(unitText, !gauge.getUnit().isEmpty());
            enableNode(lcd,gauge.isLcdVisible());
            enableNode(lcdText,gauge.isValueVisible());
            enableNode(threshold, gauge.isThresholdVisible());
            enableNode(average, gauge.isAverageVisible());
            boolean markersVisible = gauge.getMarkersVisible();
            for (Shape shape : markerMap.values()) { Helper.enableNode(shape, markersVisible); }
            resize();
            redraw();
        } else if ("LED".equals(EVENT_TYPE)) {
            if (gauge.isLedVisible()) { drawLed(led); }
        } else if ("LCD".equals(EVENT_TYPE)) {
            if (gauge.isLcdVisible()) redraw();
        } else if ("RECALC".equals(EVENT_TYPE)) {
            angleStep = gauge.getAngleStep();
            if (gauge.getValue() < gauge.getMinValue()) {
                oldValue = gauge.getMinValue();
            }
            if (gauge.getValue() > gauge.getMaxValue()) {
                oldValue = gauge.getMaxValue();
            }
            redraw();
            rotateNeedle();
        }
    }