Adds a tag to filter events by environment
513974
private function setEnvironmentOptions()
    {
        if (empty($this->environment)) {
            return;
        }

        if (is_object($this->client) && property_exists($this->client, 'environment')) {
            $this->client->environment = $this->environment;
        }
        $this->jsOptions['environment'] = $this->environment;
    }
157057
def where_entry_tag(query, tag):
    
    if isinstance(tag, (list, set, tuple)):
        tags = [t.lower() for t in tag]
        return orm.select(e for e in query for t in e.tags if t.key in tags)
    return orm.select(e for e in query for t in e.tags if t.key == tag.lower())
993991
function has_filter( $tag, $function_to_check = false ) {
            $this->_logger->entrance( $tag );

            return has_filter( $this->get_action_tag( $tag ), $function_to_check );
        }
1203306
private boolean filter(Event event) {
        if (null == filters) return false;

        for (EventFilter filter : filters) {
            if (filter.filter(event)) {
                return true;
            }
        }
        return false;
    }
1210375
def _add_filter_node(root, filter_, value):
        """"""
        filter_el = ElementTree.SubElement(root, 'Filter')
        filter_el.set('name', filter_.name)

        # Set filter value depending on type.
        if filter_.type == 'boolean':
            # Boolean case.
            if value is True or value.lower() in {'included', 'only'}:
                filter_el.set('excluded', '0')
            elif value is False or value.lower() == 'excluded':
                filter_el.set('excluded', '1')
            else:
                raise ValueError('Invalid value for boolean filter ({})'
                                 .format(value))
        elif isinstance(value, list) or isinstance(value, tuple):
            # List case.
            filter_el.set('value', ','.join(map(str, value)))
        else:
            # Default case.
            filter_el.set('value', str(value))
1071799
def eventFilter(self, obj, event):
        
        if event.type() == event.Resize:
            self.resize(event.size())
        
        return False
304350
def attach_events(self, *events, **kwargs):
        """"""
        reg = self.registry
        insert = 'insert' in kwargs
        for e in events:
            cregexp = e.compile(self.config)
            regexp = getattr(e.regexp, 're', e.regexp)
            if regexp not in reg.events[e.iotype]:
                if insert:
                    reg.events_re[e.iotype].insert(0, (regexp, cregexp))
                else:
                    reg.events_re[e.iotype].append((regexp, cregexp))
            if insert:
                reg.events[e.iotype][regexp].insert(0, e)
            else:
                reg.events[e.iotype][regexp].append(e)
89902
def _filter_running(runnings):
    '''
    
    '''
    ret = dict((tag, value) for tag, value in six.iteritems(runnings)
               if not value['result'] or value['changes'])
    return ret
182489
def filtered(self):
        """"""
        if not is_tagged(self.tags, self.opt.tags):
            LOG.info("Skipping %s as it does not have requested tags",
                     self.path)
            return False

        if not specific_path_check(self.path, self.opt):
            LOG.info("Skipping %s as it does not match specified paths",
                     self.path)
            return False

        return True
1131779
function filterStyleTag(html, config) {
    var result;

    if (config.removeMatchedTag) {
        result = html.replace(REGEXP_TAG_STYLE, '');
    } else {
        result = html.replace(REGEXP_TAG_STYLE, function(body) {
            return escapeTags(body);
        });
    }

    return result;
}
40781
function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1)
	{
		if( is_callable($function_to_add) )
		{
			add_filter($tag, $function_to_add, $priority, $accepted_args);
		}
	}
1173055
function filterScriptTag(html, config) {
    var result;

    if (config.removeMatchedTag) {
        result = html.replace(REGEXP_TAG_SCRIPT, '');
    } else {
        result = html.replace(REGEXP_TAG_SCRIPT, function(body) {
            return escapeTags(body);
        });
    }

    return result;
}
84261
def event_filters(&blk)
      if block_given?
        self.event_filters.select(&blk)
      else
        Thresholds.new(@thresholds.select{|t| t.class.to_s == "Threshold::EventFilter"})
      end
    end
194568
def filter(self):  # noqa A001
        """"""

        return [tag for tag in self.get_contents(self.tag) if not self.is_navigable_string(tag) and self.match(tag)]
1040699
def set_(name, add, match):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'comment': '',
           'result': True}
    if name not in __reg__:
        __reg__[name] = {}
        __reg__[name]['val'] = set()
    for event in __events__:
        if salt.utils.stringutils.expr_match(event['tag'], match):
            try:
                val = event['data']['data'].get(add)
            except KeyError:
                val = event['data'].get(add)
            if val is None:
                val = 'None'
            ret['changes'][add] = val
            __reg__[name]['val'].add(val)
    return ret
23465
function filterTags(tags, content) {
  if (!tags) {
    return content;
  }
  const $ = cheerio.load(content, { xmlMode: false });
  const tagOperations = tags.map(tag => ({
    // Trim leading + or -, replace * with .*, add ^ and $
    tagExp: `^${escapeRegExp(tag.replace(/^(\+|-)/g, '')).replace(/\\\*/, '.*')}$`,
    // Whether it is makes tags visible or hides them
    isHidden: tag.startsWith('-'),
  }));
  $('[tags]').each((i, element) => {
    $(element).attr('hidden', true);
    $(element).attr('tags').split(' ').forEach((tag) => {
      tagOperations.forEach((tagOperation) => {
        if (!tag.match(tagOperation.tagExp)) {
          return;
        }
        if (tagOperation.isHidden) {
          $(element).attr('hidden', true);
        } else {
          $(element).removeAttr('hidden');
        }
      });
    });
  });
  $('[hidden]').remove();
  return $.html();
}
201313
function add_filter( $tag, $function_to_add, $priority = WP_FS__DEFAULT_PRIORITY, $accepted_args = 1 ) {
            $this->_logger->entrance( $tag );

            add_filter( $this->get_action_tag( $tag ), $function_to_add, $priority, $accepted_args );
        }