Create a :class:`_EpollSelectorEvents` instance out of a bit mask using
        ``EPOLL*`` family of constants.
960903
def from_epoll_events(cls, epoll_events):
        
        self = cls()
        if epoll_events & select.EPOLLIN:
            self |= EVENT_READ
        if epoll_events & select.EPOLLOUT:
            self |= EVENT_WRITE
        # Treat EPOLLHUP specially, as both 'read and write ready' so that on
        # the outside this can be interpreted as EOF
        if epoll_events & select.EPOLLHUP:
            self |= EVENT_READ | EVENT_WRITE
        return self
190572
function simulateMouseEvent(e) {
  e.preventDefault();
  const touch = e.changedTouches[0];
  const eventMap = {
    'touchstart': 'mousedown',
    'touchmove': 'mousemove',
    'touchend': 'mouseup'
  }

  touch.target.dispatchEvent(new MouseEvent(eventMap[e.type], {
    bubbles: true,
    cancelable: true,
    view: window,
    clientX: touch.clientX,
    clientY: touch.clientY,
    screenX: touch.screenX,
    screenY: touch.screenY,
  }));
}
667106
function ( MouseEvent ) { 
		MouseEvent.preventDefault();

		var SelectedElement = MouseEvent.target;
		while ( SelectedElement && SelectedElement.className && ( -1 === SelectedElement.className.indexOf ('PinControl-Pin' ) ) ) {
			SelectedElement = SelectedElement.parentNode;
		}
		if ( SelectedElement && SelectedElement.className && ( -1 !== SelectedElement.className.indexOf ('PinControl-Pin' ) ) ) {
			_Pins.zoomTo ( SelectedElement.dataset.pinRange );
		}
		MouseEvent.stopPropagation ( );
	}
401252
function () {

		Point.prototype.init.apply(this, arguments);

		var point = this,
			toggleSlice;

		// Disallow negative values (#1530)
		if (point.y < 0) {
			point.y = null;
		}

		//visible: options.visible !== false,
		extend(point, {
			visible: point.visible !== false,
			name: pick(point.name, 'Slice')
		});

		// add event listener for select
		toggleSlice = function (e) {
			point.slice(e.type === 'select');
		};
		addEvent(point, 'select', toggleSlice);
		addEvent(point, 'unselect', toggleSlice);

		return point;
	}
726072
function createMouseEvent(type, options) {
  options = clean(type, options);
  var e = document.createEvent('MouseEvent');
  e.initMouseEvent(
    type,
    options.bubbles,
    options.cancelable,
    options.view,
    options.detail,
    options.screenX,
    options.screenY,
    options.clientX,
    options.clientY,
    options.ctrl,
    options.alt,
    options.shift,
    options.meta,
    options.button,
    options.relatedTarget
  );
  return e;
}
1286012
function delegateHandler(evt, selector, handler) {
    const scopeSelector = `[${randomID}="${randomID}"] `;
    const splittedSelector = selector.split(',');

    let matching = '';

    for (let i = 0; i < splittedSelector.length; i++) {
        const sel = splittedSelector[i];
        matching += `${i === 0 ? '' : ','}${scopeSelector}${sel},${scopeSelector}${sel} *`;
    }


    this.setAttribute(randomID, randomID);

    if (is(evt.target, matching)) {
        handler.call(this, evt);
    }

    this.removeAttribute(randomID);
}
160390
function toBitMask(event) {
    if (!_.has(eventMap, event)) {
        throw new Error('Unkown event: ' + event);
    }
    return eventMap[event];
}
25352
def run(self, timeout = 0):
        
        ptimeout = int(timeout.microseconds/1000+timeout.seconds*1000
                if timeout else (self.m_resolution if timeout is None else 0))
        if self.tokens:
            epoll_fd = self.epoll_fd
            events = epoll_wait(epoll_fd, 1024, ptimeout)
            len_events = len(events)-1
            for nr, (ev, fd) in enumerate(events):
                act = self.shadow.pop(fd)
                if ev & EPOLLHUP:
                    epoll_ctl(self.epoll_fd, EPOLL_CTL_DEL, fd, 0)
                    self.handle_error_event(act, 'Hang up.', ConnectionClosed)
                elif ev & EPOLLERR:
                    epoll_ctl(self.epoll_fd, EPOLL_CTL_DEL, fd, 0)
                    self.handle_error_event(act, 'Unknown error.')
                else:
                    if nr == len_events:
                        ret = self.yield_event(act)
                        if not ret:
                            epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, ev | EPOLLONESHOT)
                            self.shadow[fd] = act
                        return ret
                    else:
                        if not self.handle_event(act):
                            epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fd, ev | EPOLLONESHOT)
                            self.shadow[fd] = act

        else:
            sleep(timeout)
997643
def _gen_input_mask(mask):
    """"""
    return input_mask(
        shift=bool(mask & MOD_Shift),
        lock=bool(mask & MOD_Lock),
        control=bool(mask & MOD_Control),
        mod1=bool(mask & MOD_Mod1),
        mod2=bool(mask & MOD_Mod2),
        mod3=bool(mask & MOD_Mod3),
        mod4=bool(mask & MOD_Mod4),
        mod5=bool(mask & MOD_Mod5))
156467
def set_x10_all_bit_mask(self, x10_all_bit_mask):
        """"""
        set_cmd = self._create_set_property_msg("_x10_all_bit_mask", 0x0a,
                                                x10_all_bit_mask)
        self._send_method(set_cmd, self._property_set)
196470
function () {

            Overlay.superclass.initEvents.call(this);

            var SIGNATURE = CustomEvent.LIST;

            /**
            * CustomEvent fired before the Overlay is moved.
            * @event beforeMoveEvent
            * @param {Number} x x coordinate
            * @param {Number} y y coordinate
            */
            this.beforeMoveEvent = this.createEvent(EVENT_TYPES.BEFORE_MOVE);
            this.beforeMoveEvent.signature = SIGNATURE;

            /**
            * CustomEvent fired after the Overlay is moved.
            * @event moveEvent
            * @param {Number} x x coordinate
            * @param {Number} y y coordinate
            */
            this.moveEvent = this.createEvent(EVENT_TYPES.MOVE);
            this.moveEvent.signature = SIGNATURE;

        }
695681
function createSelectionTrimmer(methodName) {
        return createEntryPointFunction(
            function(session, characterOptions) {
                var trimmed = false;
                this.changeEachRange(function(range) {
                    trimmed = range[methodName](characterOptions) || trimmed;
                });
                return trimmed;
            }
        );
    }
352321
function setupEvent(element, eType, handler, capture) {
  notifyOfNextSubs[eType] = [];
  subsIDs[eType] = {};
  element.addEventListener(
    eType,
    handler,
    passiveEventSupport
      ? {
          capture,
          // don't set click listener as passive because syntheticClick may call preventDefault
          passive: eType !== 'click',
        }
      : capture,
  );
}
776775
function () {

		Point.prototype.init.apply(this, arguments);

		var point = this,
			toggleSlice;

		//visible: options.visible !== false,
		extend(point, {
			visible: point.visible !== false,
			name: pick(point.name, 'Slice')
		});

		// add event listener for select
		toggleSlice = function () {
			point.slice();
		};
		addEvent(point, 'select', toggleSlice);
		addEvent(point, 'unselect', toggleSlice);

		return point;
	}
815743
function createMouseEvent(eventName, originalEvent, finger) {
    var e = document.createEvent('MouseEvent');

    e.initMouseEvent(eventName, true, true,
      originalEvent.view, originalEvent.detail,
      finger.x || originalEvent.screenX, finger.y || originalEvent.screenY,
      finger.x || originalEvent.clientX, finger.y || originalEvent.clientY,
      originalEvent.ctrlKey, originalEvent.shiftKey,
      originalEvent.altKey, originalEvent.metaKey,
      originalEvent.button, finger.target || originalEvent.relatedTarget
    );

    e.synthetic = true;

    // Set this so we can match shared targets later.
    e._finger = finger;

    return e;
  }
400361
private Producer<CloseableReference<CloseableImage>> newBitmapCacheGetToLocalTransformSequence(
      Producer<EncodedImage> inputProducer) {
    ThumbnailProducer<EncodedImage>[] defaultThumbnailProducers = new ThumbnailProducer[1];
    defaultThumbnailProducers[0] = mProducerFactory.newLocalExifThumbnailProducer();
    return newBitmapCacheGetToLocalTransformSequence(inputProducer, defaultThumbnailProducers);
  }
799421
def _create_select_window_handler(self, window):
        "  "
        def handler(mouse_event):
            if mouse_event.event_type == MouseEventType.MOUSE_DOWN:
                self.pymux.arrangement.set_active_window(window)
                self.pymux.invalidate()
            else:
                return NotImplemented  # Event not handled here.
        return handler