SELECT - Evaluate the tag that matches the argument's value.
166737
private void evalSelect(MessageArg arg) {
    tag.skip(COMMA_WS);
    int pos = -1;
    int end = -1;
    String value = arg.asString();
    while (tag.peek() != Chars.EOF) {
      if (!tag.seek(NON_WS, choice)) {
        break;
      }
      
      String token = choice.token().toString();
      tag.jump(choice);
      tag.skip(COMMA_WS);
      if (!tag.seekBounds(choice, '{', '}')) {
        break;
      }
      
      if (token.equals(value)) {
        recurse(choice, value);
        return;
      } else if (token.equals("other")) {
        pos = choice.pos;
        end = choice.end;
      } else {
        tag.jump(choice);
        tag.skip(COMMA_WS);
      }
    }

    // Evaluate the "other" tag if nothing matched.
    if (pos != -1 && end != -1) {
      choice.set(pos, end);
      recurse(choice, value);
    }
  }
815124
def selectin(table, field, value, complement=False):
    """"""

    return select(table, field, lambda v: v in value,
                  complement=complement)
1263017
def tag(self, name: str) -> models.Tag:
        """"""
        return self.Tag.filter_by(name=name).first()
713081
function matchToHolders(match, tag) {
  return object(match.map(function(val, index) {
    return [tag+":"+index, val];
  }));
}
857768
def valid(cls, data, context=None):
        """"""
        return cls(cls.TagType.VALID, data, context)
1052537
def custom_filter_tags(self, value, search):
        """"""
        if not isinstance(value, list):
            value = value.split(',')

        filters = [Q('match', **{'tags': item}) for item in value]
        search = search.query('bool', must=filters)

        return search
544112
private void evalPlural(MessageArg arg, boolean cardinal) {
    tag.skip(COMMA_WS);
    if (!arg.resolve()) {
      return;
    }

    String value = arg.asString();
    String offsetValue = value;

    // Look for optional "offset:<number>" argument. This modifies the argument value,
    // changing the plural operands calculation.
    long offset = 0;
    if (tag.seek(PLURAL_OFFSET, choice)) {
      tag.jump(choice);
      tag.skip(COMMA_WS);

      // Parse the offset digits and the argument value.
      offset = toLong(format, choice.pos + 7, choice.end);
      long newValue = toLong(value, 0, value.length()) - offset;

      // Operands are evaluated based on the offset-adjusted value.
      offsetValue = Long.toString(newValue);
      operands.set(offsetValue);
    } else {
      operands.set(value);
    }

    // Evaluate the plural operands for the current argument.
    String language = locale.language();
    PluralCategory category = cardinal 
        ? PLURAL_RULES.evalCardinal(language, operands) 
        : PLURAL_RULES.evalOrdinal(language, operands);
        
    Recognizer matcher = PLURAL_MATCHERS[category.ordinal()];

    // Scan over the potential choices inside this tag. We will evaluate
    // the first choice that matches our plural category.
    char ch;
    while ((ch = tag.peek()) != Chars.EOF) {
      // First look for explicit match, falling back to a plural category.
      if (ch == '=' && tag.seek(PLURAL_EXPLICIT, choice)) {
        tag.jump(choice);

        // Skip the '=' character.
        choice.pos++;

        // If our argument matches the exact value, recurse and then return.
        String repr = choice.token().toString();
        if (repr.equals(value) && tag.seekBounds(choice, '{', '}')) {
          recurse(choice, offsetValue);
          return;
        }

      } else if (tag.seek(matcher, choice)) {
        // Jump over the plural category.
        tag.jump(choice);
        tag.skipWs();

        // If the choice format is valid, recurse and then return.
        if (tag.peek() == '{' && tag.seekBounds(choice, '{', '}')) {
          recurse(choice, offsetValue);
        }
        return;
      }

      // Skip over this choice and any trailing whitespace, or bail out if no match.
      if (!tag.seekBounds(choice, '{', '}')) {
        return;
      }
      tag.jump(choice);
      tag.skip(COMMA_WS);
    }
  }
902148
private void evaluateTag(StringBuilder buf) {
    // Trim the '{' and '}' bounding characters.
    tag.pos++;
    tag.end--;

    // If this tag has been hidden from the processor, skip over the '-' and
    // emit the tag body.
    if (tag.peek() == Chars.MINUS_SIGN) {
      tag.pos++;
      buf.append('{');
      buf.append(tag.token());
      buf.append('}');
      return;
    }
    
    List<MessageArg> args = getArgs();
    if (args == null || args.size() == 0) {
      return;
    }

    MessageArg arg = args.get(0);

    // Process a short tag like "{1}" by just appending the argument value.
    if (tag.peek() == Chars.EOF) {
      if (arg.resolve()) {
        buf.append(arg.asString());
      }
      return;
    }

    // Parse the formatter name and execute the associated formatting method.
    if (tag.seek(FORMATTER, choice)) {
      String formatter = choice.token().toString();
      tag.jump(choice);
      switch (formatter) {
        case PLURAL:
          evalPlural(arg, true);
          break;

        case SELECTORDINAL:
          evalPlural(arg, false);
          break;

        case SELECT:
          evalSelect(arg);
          break;
          
        case CURRENCY:
        case MONEY:
          evalCurrency(arg);
          break;

        case DATETIME:
          evalDateTime(arg);
          break;
          
        case DATETIME_INTERVAL:
          evalDateTimeInterval(args);
          break;

        case DECIMAL:
        case NUMBER:
          evalNumber(arg);
          break;
          
        case UNIT:
          evalUnit(arg);
          break;
      }
    }
  }
1290975
def iselect(select, tag, namespaces=None, limit=0, flags=0, **kwargs):
    """"""

    for el in compile(select, namespaces, flags, **kwargs).iselect(tag, limit):
        yield el
638977
def _select_helper(args, kwargs):
    
    if len(args) > 1:
        raise TypeError("select accepts at most ONE positional argument.")

    if len(args) > 0 and len(kwargs) > 0:
        raise TypeError("select accepts EITHER a positional argument, OR keyword arguments (not both).")

    if len(args) == 0 and len(kwargs) == 0:
        raise TypeError("select requires EITHER a positional argument, OR keyword arguments.")

    if args:
        arg = args[0]
        if isinstance(arg, dict):
            selector = arg
        elif isinstance(arg, string_types):
            selector = dict(name=arg)
        elif isinstance(arg, type) and issubclass(arg, Model):
            selector = {"type": arg}
        else:
            raise TypeError("selector must be a dictionary, string or plot object.")

    elif 'selector' in kwargs:
        if len(kwargs) == 1:
            selector = kwargs['selector']
        else:
            raise TypeError("when passing 'selector' keyword arg, not other keyword args may be present")

    else:
        selector = kwargs

    return selector
962997
function( value, element, param ) {
			// check if dependency is met
			if ( !this.depend(param, element) ) {
				return "dependency-mismatch";
			}
			if ( element.nodeName.toLowerCase() === "select" ) {
				// could be an array for select-multiple or a string, both are fine this way
				var val = $(element).val();
				return val && val.length > 0;
			}
			if ( this.checkable(element) ) {
				return this.getLength(value, element) > 0;
			}
			return $.trim(value).length > 0;
		}
71391
def selecteq(table, field, value, complement=False):
    """"""

    return selectop(table, field, value, operator.eq, complement=complement)
1099336
def get_tag_value(x, key):
    """"""
    if x is None:
        return ''
    result = [y['Value'] for y in x if y['Key'] == key]
    if result:
        return result[0]
    return ''
289215
def value
      case tag_name
      when "select"
        if self[:multiple]
          selected_options.map { |option| option.value }
        else
          selected_option = @_node.selected_options.first
          selected_option ? Node.new(selected_option).value : nil
        end
      when "option"
        self[:value] || text
      when "textarea"
        @_node.getText
      else
        self[:value]
      end
    end
420555
function parseTagged(definition, taggedTypes) {
	let match = definition.match(/^(\w+)(?:\((.*)\))?$/),
		tag, args, typeInfo
	if (!match) {
		return
	}

	// Get type info
	tag = match[1]
	typeInfo = taggedTypes[tag]
	if (!typeInfo) {
		return
	}

	// Special no-'()' case: only match 'tag' if minArgs is zero
	if (typeInfo.minArgs > 0 && match[2] === undefined) {
		return
	}

	// Parse and check args
	args = (match[2] || '').trim().split(/\s*,\s*/)
	if (args.length === 1 && args[0] === '') {
		// Especial empty case
		args = []
	}
	args = args.map((arg, i) => {
		if (!arg) {
			if (!typeInfo.sparse) {
				throw new Error('Missing argument at position ' + i + ' for tagged type ' + tag)
			}
			return
		}

		if (typeInfo.numeric) {
			arg = Number(arg)
			if (isNaN(arg)) {
				throw new Error('Invalid numeric argument at position ' + i + ' for tagged type ' + tag)
			}
		}

		return arg
	})
	args.original = definition
	if (args.length < typeInfo.minArgs) {
		throw new Error('Too few arguments for tagged type ' + tag)
	} else if (typeInfo.maxArgs && args.length > typeInfo.maxArgs) {
		throw new Error('Too many arguments for tagged type ' + tag)
	}

	return new Field(typeInfo.type, typeInfo.parseArgs ? typeInfo.parseArgs(args) : args)
}
840127
def selectcontains(table, field, value, complement=False):
    """"""

    return selectop(table, field, value, operator.contains,
                    complement=complement)
1092619
def Tag(self, key, value):
        
        if not self._tags:
            self._tags = {}
        self._tags[key] = value