Given a tag and single run, return array of ScalarEvents.
344843
def scalars_route(self, request):
    """"""
    # TODO: return HTTP status code for malformed requests
    tag = request.args.get('tag')
    run = request.args.get('run')
    experiment = request.args.get('experiment')
    output_format = request.args.get('format')
    (body, mime_type) = self.scalars_impl(tag, run, experiment, output_format)
    return http_util.Respond(request, body, mime_type)
620930
function getTagValues(littleEndian, dirEntries) {
        var TAG_VAL_OFFSET = 16,
            tagsToFind = qq.extend([], TAG_IDS),
            vals = {};

        qq.each(dirEntries, function(idx, entry) {
            var idHex = entry.slice(0, 4),
                id = littleEndian ? parseLittleEndian(idHex) : parseInt(idHex, 16),
                tagsToFindIdx = tagsToFind.indexOf(id),
                tagValHex, tagName, tagValLength;

            if (tagsToFindIdx >= 0) {
                tagName = TAG_INFO[id].name;
                tagValLength = TAG_INFO[id].bytes;
                tagValHex = entry.slice(TAG_VAL_OFFSET, TAG_VAL_OFFSET + (tagValLength * 2));
                vals[tagName] = littleEndian ? parseLittleEndian(tagValHex) : parseInt(tagValHex, 16);

                tagsToFind.splice(tagsToFindIdx, 1);
            }

            if (tagsToFind.length === 0) {
                return false;
            }
        });

        return vals;
    }
207115
def events
      return @events if @events
      @events = []
      path = "events/available/#{language_code}"
      result = call(path, http_method: :get)
      for event in result
        @events << ShakeTheCounter::Event.new(event, client: self)
      end
      return @events
    end
919398
def build_event_handler(self, runnable, regime, event_handler):
        

        if isinstance(event_handler, OnCondition):
            return self.build_on_condition(runnable, regime, event_handler)
        elif isinstance(event_handler, OnEvent):
            return self.build_on_event(runnable, regime, event_handler)
        elif isinstance(event_handler, OnStart):
            return self.build_on_start(runnable, regime, event_handler)
        elif isinstance(event_handler, OnEntry):
            return self.build_on_entry(runnable, regime, event_handler)
        else:
            return []
681518
public function getEvents(array $tags = []): array
    {
        if ($tags === []) {
            return $this->events;
        }

        return array_filter($this->events, function (ScheduleEvent $event) use ($tags) {
            return array_intersect($event->getTags(), $tags) === $tags;
        });
    }
494939
function(event_names) {

		var i = 0,
			count = event_names.length,
			result = [];

		for (; i < count; i++) {

			if (Lava.schema.system.DEFAULT_EVENTS.indexOf(event_names[i]) == -1) {

				result.push(event_names[i]);

			}

		}

		return result;

	}
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
}
429020
def filter_event(tag, data, defaults):
    '''
    
    '''
    ret = {}
    keys = []
    use_defaults = True

    for ktag in __opts__.get('filter_events', {}):
        if tag != ktag:
            continue
        keys = __opts__['filter_events'][ktag]['keys']
        use_defaults = __opts__['filter_events'][ktag].get('use_defaults', True)

    if use_defaults is False:
        defaults = []

    # For PY3, if something like ".keys()" or ".values()" is used on a dictionary,
    # it returns a dict_view and not a list like in PY2. "defaults" should be passed
    # in with the correct data type, but don't stack-trace in case it wasn't.
    if not isinstance(defaults, list):
        defaults = list(defaults)

    defaults = list(set(defaults + keys))

    for key in defaults:
        if key in data:
            ret[key] = data[key]

    return ret
699091
def events(self):
        
        all_events = [{ensure_unicode(key): value for key, value in iteritems(ev)} for ev in self._events]

        for ev in all_events:
            to_decode = []
            for key, value in iteritems(ev):
                if isinstance(value, binary_type) and key != 'host':
                    to_decode.append(key)
            for key in to_decode:
                ev[key] = ensure_unicode(ev[key])

            if ev.get('tags'):
                ev['tags'] = normalize_tags(ev['tags'])

        return all_events
291422
def get_events_by_ses(self, events, num_ses):
        
        numpy.random.seed(self.serial)
        sess = numpy.random.choice(num_ses, len(events)) + 1
        events_by_ses = collections.defaultdict(list)
        for ses, event in zip(sess, events):
            events_by_ses[ses].append(event)
        for ses in events_by_ses:
            events_by_ses[ses] = numpy.array(events_by_ses[ses])
        return events_by_ses
979395
def events(self, **kwargs):
        
        events_result = self.service.events().list(**kwargs).execute()
        return [Event(event) for event in events_result.get("items", [])]
1134827
def events(self):
        ''''''
        ret = []
        while self.out_queue.qsize():
            ret.append(self.out_queue.get())
        return ret
764317
def matchesWithMatchers(self, event):
        '''
        
        '''
        ret = []
        self._matches(event, set(), ret)
        return tuple(ret)
1244740
def getElementsByTagName(start_node: ParentNode, tag: str) -> NodeList:
    """"""
    _tag = tag.upper()
    return getElementsBy(start_node, lambda node: node.tagName == _tag)
289049
def _tags(self, tags, event_code):
        ''' 
        '''
        tags_list = []
        if tags is not None:
            tags_list += list(tags)
        tags_list.append("event_id:{event_id}".format(event_id=event_code))
        return tags_list
1293305
def _getEventsByWeek(self, request, year, month):
        """"""
        return getAllEventsByWeek(request, year, month, home=self)
934191
def getAllEvents(request, *, home=None):
    
    qrys = [SimpleEventPage.events(request).all(),
            MultidayEventPage.events(request).all(),
            RecurringEventPage.events(request).all()]
    # Does not return exceptions
    if home is not None:
        qrys = [qry.descendant_of(home) for qry in qrys]
    events = sorted(chain.from_iterable(qrys),
                    key=attrgetter('_first_datetime_from'))
    return events