Return secondary event types that occurrences must belong to, or `None`
        if there is no constraint on secondary type.
548011
def parse_secondary_types(self, request):
        
        if request.GET.getlist('secondary_types'):
            return EventType.objects.filter(
                slug__in=request.GET.getlist('secondary_types'))
        return None
874633
def get_events(conn, stackname):
    """"""
    next = None
    event_list = []
    while 1:
        events = conn.describe_stack_events(stackname, next)
        event_list.append(events)
        if events.next_token is None:
            break
        next = events.next_token
        time.sleep(1)
    return reversed(sum(event_list, []))
1262130
def event_first_of(*events: _AbstractLinkable) -> Event:
    
    first_finished = Event()

    if not all(isinstance(e, _AbstractLinkable) for e in events):
        raise ValueError('all events must be linkable')

    for event in events:
        event.rawlink(lambda _: first_finished.set())

    return first_finished
751618
def getEventTypeNameFromEnum(self, eType):
        """"""

        fn = self.function_table.getEventTypeNameFromEnum
        result = fn(eType)
        return result
846041
protected <T> Optional<T> getSource(Event event, Class<T> type) {
        return getValue(event, event::getSource, type);
    }
1327863
private static Optional<String> getAuditEventType(final List<String> eventType, final List<String> resourceType) {
        // mapping event type/properties to audit event type
        if (eventType.contains(EVENT_NAMESPACE + "ResourceCreation") || eventType.contains(AS_NAMESPACE + "Create")) {
            if (resourceType.contains(REPOSITORY + "Binary")) {
                return of(CONTENT_ADD);
            } else {
                return of(OBJECT_ADD);
            }
        } else if (eventType.contains(EVENT_NAMESPACE + "ResourceDeletion") ||
                eventType.contains(AS_NAMESPACE + "Delete")) {
            if (resourceType.contains(REPOSITORY + "Binary")) {
                return of(CONTENT_REM);
            } else {
                return of(OBJECT_REM);
            }
        } else if (eventType.contains(EVENT_NAMESPACE + "ResourceModification") ||
                eventType.contains(AS_NAMESPACE + "Update")) {
            if (resourceType.contains(REPOSITORY + "Binary")) {
                return of(CONTENT_MOD);
            } else {
                return of(METADATA_MOD);
            }
        }
        return empty();
    }
448173
def _no_primary(max_staleness, selection):
    """"""
    # Secondary that's replicated the most recent writes.
    smax = selection.secondary_with_max_last_write_date()
    if not smax:
        # No secondaries and no primary, short-circuit out of here.
        return selection.with_server_descriptions([])

    sds = []

    for s in selection.server_descriptions:
        if s.server_type == SERVER_TYPE.RSSecondary:
            # See max-staleness.rst for explanation of this formula.
            staleness = (smax.last_write_date -
                         s.last_write_date +
                         selection.heartbeat_frequency)

            if staleness <= max_staleness:
                sds.append(s)
        else:
            sds.append(s)

    return selection.with_server_descriptions(sds)
692652
def _secondary_values(self):
        """"""
        return [
            val for serie in self.secondary_series for val in serie.values
            if val is not None
        ]
658704
def keyevent2tuple(event):
    """"""
    return (event.type(), event.key(), event.modifiers(), event.text(),
            event.isAutoRepeat(), event.count())
589386
function getOverrides (eventType, options) {
  if (eventType === 'KeyboardEvent' && options) {
    return {
      keyCode: options.keyCode || 0,
      key: options.key || 0,
      which: options.which || options.keyCode || 0
    }
  }
}
1216526
function tableFromEvents(eventsObj) {
  const headers = ["Event Name", "Type", "Description"]
  let rows = []

  for(const evt in eventsObj) {
    let cols = []

    cols.push(`${evt}`) // event name
    
    let typeList = ''
    eventsObj[evt]["type"]["names"].forEach((type, idx, arr) => {
      typeList += `${type}${arr[idx+1] ? `|` : ''}`
    })
    cols.push(typeList) // list of event types
    cols.push(`${eventsObj[evt]["description"]}`) // description of the event

    rows.push(cols);
  }

  return rows.length > 0 ? {table: {headers, rows}} : null
}
197663
function interpret_events() {

        // Do not prevent default if no event could be interpreted
        var handled_event = interpret_event();
        if (!handled_event)
            return false;

        // Interpret as much as possible
        var last_event;
        do {
            last_event = handled_event;
            handled_event = interpret_event();
        } while (handled_event !== null);

        return last_event.defaultPrevented;

    }
426234
def singleton_events(all = true)
      if all
        contributors  = self.singleton_class.included_modules
        contributors -= self.class.included_modules
        contributors.push self.singleton_class
        Unobservable.collect_instance_events_defined_by(contributors)
      else
        Unobservable.collect_instance_events_defined_by([self.singleton_class])
      end
    end
921578
def _validate_other_keys(optional, types, missing, validated, data,
                         to_validate):
    """"""
    errors = []
    for key in to_validate:
        value = data[key]
        if key in optional:
            errors.extend(
                _validate_optional_key(
                    key, missing, value, validated, optional))
            continue
        errors.extend(_validate_type_key(key, value, types, validated))
    return errors
610179
def matchfirst(self, event):
        '''
        
        '''
        # 1. matches(self.index[ind], event)
        # 2. matches(self.any, event)
        # 3. self.matches
        if self.depth < len(event.indices):
            ind = event.indices[self.depth]
            if ind in self.index:
                m = self.index[ind].matchfirst(event)
                if m is not None:
                    return m
            if hasattr(self, 'any'):
                m = self.any.matchfirst(event)
                if m is not None:
                    return m
        if self._use_dict:
            for o, m in self.matchers_dict:
                if m is None or m.judge(event):
                    return o
        else:
            for o, m in self.matchers_list:
                if m is None or m.judge(event):
                    return o
120099
def re(self, event_property, value):
        
        c = self.copy()
        c.filters.append(filters.RE(event_property, value))
        return c
286858
def p_NonAnyType_object(p):
  """"""
  p[0] = helper.unwrapTypeSuffix(model.SimpleType(
    type=model.SimpleType.OBJECT), p[2])